2 * linux/arch/m68k/mac/config.c
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
10 * Miscellaneous linux stuff
13 #include <linux/config.h>
14 #include <linux/module.h>
15 #include <linux/types.h>
17 #include <linux/tty.h>
18 #include <linux/console.h>
19 #include <linux/interrupt.h>
21 #include <linux/random.h>
22 #include <linux/delay.h>
24 #include <linux/init.h>
25 #include <linux/vt_kern.h>
27 #define BOOTINFO_COMPAT_1_0
28 #include <asm/setup.h>
29 #include <asm/bootinfo.h>
31 #include <asm/system.h>
34 #include <asm/pgtable.h>
36 #include <asm/machdep.h>
38 #include <asm/macintosh.h>
39 #include <asm/macints.h>
40 #include <asm/machw.h>
42 #include <asm/mac_iop.h>
43 #include <asm/mac_via.h>
44 #include <asm/mac_oss.h>
45 #include <asm/mac_psc.h>
47 /* Mac bootinfo struct */
49 struct mac_booter_data mac_bi_data;
50 int mac_bisize = sizeof mac_bi_data;
52 struct mac_hw_present mac_hw_present;
54 /* New m68k bootinfo stuff and videobase */
56 extern int m68k_num_memory;
57 extern struct mem_info m68k_memory[NUM_MEMINFO];
59 extern struct mem_info m68k_ramdisk;
61 extern char m68k_command_line[CL_SIZE];
63 void *mac_env; /* Loaded by the boot asm */
65 /* The phys. video addr. - might be bogus on some machines */
66 unsigned long mac_orig_videoaddr;
68 /* Mac specific timer functions */
69 extern unsigned long mac_gettimeoffset (void);
70 extern int mac_hwclk (int, struct rtc_time *);
71 extern int mac_set_clock_mmss (unsigned long);
72 extern int show_mac_interrupts(struct seq_file *, void *);
73 extern void iop_preinit(void);
74 extern void iop_init(void);
75 extern void via_init(void);
76 extern void via_init_clock(irqreturn_t (*func)(int, void *, struct pt_regs *));
77 extern void via_flush_cache(void);
78 extern void oss_init(void);
79 extern void psc_init(void);
80 extern void baboon_init(void);
82 extern void mac_mksound(unsigned int, unsigned int);
84 extern void nubus_sweep_video(void);
86 /* Mac specific debug functions (in debug.c) */
87 extern void mac_debug_init(void);
88 extern void mac_debugging_long(int, long);
90 static void mac_get_model(char *str);
92 static void mac_sched_init(irqreturn_t (*vector)(int, void *, struct pt_regs *))
94 via_init_clock(vector);
98 * Parse a Macintosh-specific record in the bootinfo
101 int __init mac_parse_bootinfo(const struct bi_record *record)
104 const u_long *data = record->data;
106 switch (record->tag) {
108 mac_bi_data.id = *data;
111 mac_bi_data.videoaddr = *data;
114 mac_bi_data.videodepth = *data;
117 mac_bi_data.videorow = *data;
120 mac_bi_data.dimensions = *data;
122 case BI_MAC_VLOGICAL:
123 mac_bi_data.videological = VIDEOMEMBASE + (*data & ~VIDEOMEMMASK);
124 mac_orig_videoaddr = *data;
127 mac_bi_data.sccbase = *data;
130 mac_bi_data.boottime = *data;
133 mac_bi_data.gmtbias = *data;
136 mac_bi_data.memsize = *data;
139 mac_bi_data.cpuid = *data;
142 mac_bi_data.rombase = *data;
151 * Flip into 24bit mode for an instant - flushes the L2 cache card. We
152 * have to disable interrupts for this. Our IRQ handlers will crap
153 * themselves if they take an IRQ in 24bit mode!
156 static void mac_cache_card_flush(int writeback)
159 local_irq_save(flags);
161 local_irq_restore(flags);
164 void __init config_mac(void)
167 printk(KERN_ERR "ERROR: no Mac, but config_mac() called!! \n");
170 mach_sched_init = mac_sched_init;
171 mach_init_IRQ = mac_init_IRQ;
172 mach_get_model = mac_get_model;
173 mach_gettimeoffset = mac_gettimeoffset;
174 #warning move to adb/via init
176 mach_hwclk = mac_hwclk;
178 mach_set_clock_mmss = mac_set_clock_mmss;
179 mach_reset = mac_reset;
180 mach_halt = mac_poweroff;
181 mach_power_off = mac_poweroff;
182 mach_max_dma_address = 0xffffffff;
184 mach_debug_init = mac_debug_init;
186 #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE)
187 mach_beep = mac_mksound;
189 #ifdef CONFIG_HEARTBEAT
191 mach_heartbeat = mac_heartbeat;
192 mach_heartbeat_irq = IRQ_MAC_TIMER;
197 * Determine hardware present
201 mac_report_hardware();
203 /* AFAIK only the IIci takes a cache card. The IIfx has onboard
204 cache ... someone needs to figure out how to tell if it's on or
207 if (macintosh_config->ident == MAC_MODEL_IICI
208 || macintosh_config->ident == MAC_MODEL_IIFX) {
209 mach_l2_flush = mac_cache_card_flush;
213 * Check for machine specific fixups.
216 #ifdef OLD_NUBUS_CODE
223 * Macintosh Table: hardcoded model configuration data.
225 * Much of this was defined by Alan, based on who knows what docs.
226 * I've added a lot more, and some of that was pure guesswork based
227 * on hardware pages present on the Mac web site. Possibly wildly
228 * inaccurate, so look here if a new Mac model won't run. Example: if
229 * a Mac crashes immediately after the VIA1 registers have been dumped
230 * to the screen, it probably died attempting to read DirB on a RBV.
231 * Meaning it should have MAC_VIA_IIci here :-)
234 struct mac_model *macintosh_config;
235 EXPORT_SYMBOL(macintosh_config);
237 static struct mac_model mac_data_table[]=
240 * We'll pretend to be a Macintosh II, that's pretty safe.
244 .ident = MAC_MODEL_II,
246 .adb_type = MAC_ADB_II,
247 .via_type = MAC_VIA_II,
248 .scsi_type = MAC_SCSI_OLD,
249 .scc_type = MAC_SCC_II,
250 .nubus_type = MAC_NUBUS
254 * Original MacII hardware
259 .ident = MAC_MODEL_II,
261 .adb_type = MAC_ADB_II,
262 .via_type = MAC_VIA_II,
263 .scsi_type = MAC_SCSI_OLD,
264 .scc_type = MAC_SCC_II,
265 .nubus_type = MAC_NUBUS
267 .ident = MAC_MODEL_IIX,
269 .adb_type = MAC_ADB_II,
270 .via_type = MAC_VIA_II,
271 .scsi_type = MAC_SCSI_OLD,
272 .scc_type = MAC_SCC_II,
273 .nubus_type = MAC_NUBUS
275 .ident = MAC_MODEL_IICX,
277 .adb_type = MAC_ADB_II,
278 .via_type = MAC_VIA_II,
279 .scsi_type = MAC_SCSI_OLD,
280 .scc_type = MAC_SCC_II,
281 .nubus_type = MAC_NUBUS
283 .ident = MAC_MODEL_SE30,
285 .adb_type = MAC_ADB_II,
286 .via_type = MAC_VIA_II,
287 .scsi_type = MAC_SCSI_OLD,
288 .scc_type = MAC_SCC_II,
289 .nubus_type = MAC_NUBUS
293 * Weirdified MacII hardware - all subtley different. Gee thanks
294 * Apple. All these boxes seem to have VIA2 in a different place to
295 * the MacII (+1A000 rather than +4000)
296 * CSA: see http://developer.apple.com/technotes/hw/hw_09.html
300 .ident = MAC_MODEL_IICI,
302 .adb_type = MAC_ADB_II,
303 .via_type = MAC_VIA_IIci,
304 .scsi_type = MAC_SCSI_OLD,
305 .scc_type = MAC_SCC_II,
306 .nubus_type = MAC_NUBUS
308 .ident = MAC_MODEL_IIFX,
310 .adb_type = MAC_ADB_IOP,
311 .via_type = MAC_VIA_IIci,
312 .scsi_type = MAC_SCSI_OLD,
313 .scc_type = MAC_SCC_IOP,
314 .nubus_type = MAC_NUBUS
316 .ident = MAC_MODEL_IISI,
318 .adb_type = MAC_ADB_IISI,
319 .via_type = MAC_VIA_IIci,
320 .scsi_type = MAC_SCSI_OLD,
321 .scc_type = MAC_SCC_II,
322 .nubus_type = MAC_NUBUS
324 .ident = MAC_MODEL_IIVI,
326 .adb_type = MAC_ADB_IISI,
327 .via_type = MAC_VIA_IIci,
328 .scsi_type = MAC_SCSI_OLD,
329 .scc_type = MAC_SCC_II,
330 .nubus_type = MAC_NUBUS
332 .ident = MAC_MODEL_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,
338 .nubus_type = MAC_NUBUS
342 * Classic models (guessing: similar to SE/30 ?? Nope, similar to LC ...)
346 .ident = MAC_MODEL_CLII,
347 .name = "Classic II",
348 .adb_type = MAC_ADB_IISI,
349 .via_type = MAC_VIA_IIci,
350 .scsi_type = MAC_SCSI_OLD,
351 .scc_type = MAC_SCC_II,
352 .nubus_type = MAC_NUBUS
354 .ident = MAC_MODEL_CCL,
355 .name = "Color Classic",
356 .adb_type = MAC_ADB_CUDA,
357 .via_type = MAC_VIA_IIci,
358 .scsi_type = MAC_SCSI_OLD,
359 .scc_type = MAC_SCC_II,
360 .nubus_type = MAC_NUBUS},
363 * Some Mac LC machines. Basically the same as the IIci, ADB like IIsi
367 .ident = MAC_MODEL_LC,
369 .adb_type = MAC_ADB_IISI,
370 .via_type = MAC_VIA_IIci,
371 .scsi_type = MAC_SCSI_OLD,
372 .scc_type = MAC_SCC_II,
373 .nubus_type = MAC_NUBUS
375 .ident = MAC_MODEL_LCII,
377 .adb_type = MAC_ADB_IISI,
378 .via_type = MAC_VIA_IIci,
379 .scsi_type = MAC_SCSI_OLD,
380 .scc_type = MAC_SCC_II,
381 .nubus_type = MAC_NUBUS
383 .ident = MAC_MODEL_LCIII,
385 .adb_type = MAC_ADB_IISI,
386 .via_type = MAC_VIA_IIci,
387 .scsi_type = MAC_SCSI_OLD,
388 .scc_type = MAC_SCC_II,
389 .nubus_type = MAC_NUBUS
393 * Quadra. Video is at 0xF9000000, via is like a MacII. We label it differently
394 * as some of the stuff connected to VIA2 seems different. Better SCSI chip and
395 * onboard ethernet using a NatSemi SONIC except the 660AV and 840AV which use an
397 * The 700, 900 and 950 have some I/O chips in the wrong place to
398 * confuse us. The 840AV has a SCSI location of its own (same as
403 .ident = MAC_MODEL_Q605,
404 .name = "Quadra 605",
405 .adb_type = MAC_ADB_CUDA,
406 .via_type = MAC_VIA_QUADRA,
407 .scsi_type = MAC_SCSI_QUADRA,
408 .scc_type = MAC_SCC_QUADRA,
409 .nubus_type = MAC_NUBUS
411 .ident = MAC_MODEL_Q605_ACC,
412 .name = "Quadra 605",
413 .adb_type = MAC_ADB_CUDA,
414 .via_type = MAC_VIA_QUADRA,
415 .scsi_type = MAC_SCSI_QUADRA,
416 .scc_type = MAC_SCC_QUADRA,
417 .nubus_type = MAC_NUBUS
419 .ident = MAC_MODEL_Q610,
420 .name = "Quadra 610",
421 .adb_type = MAC_ADB_II,
422 .via_type = MAC_VIA_QUADRA,
423 .scsi_type = MAC_SCSI_QUADRA,
424 .scc_type = MAC_SCC_QUADRA,
425 .ether_type = MAC_ETHER_SONIC,
426 .nubus_type = MAC_NUBUS
428 .ident = MAC_MODEL_Q630,
429 .name = "Quadra 630",
430 .adb_type = MAC_ADB_CUDA,
431 .via_type = MAC_VIA_QUADRA,
432 .scsi_type = MAC_SCSI_QUADRA,
433 .ide_type = MAC_IDE_QUADRA,
434 .scc_type = MAC_SCC_QUADRA,
435 .ether_type = MAC_ETHER_SONIC,
436 .nubus_type = MAC_NUBUS
438 .ident = MAC_MODEL_Q650,
439 .name = "Quadra 650",
440 .adb_type = MAC_ADB_II,
441 .via_type = MAC_VIA_QUADRA,
442 .scsi_type = MAC_SCSI_QUADRA,
443 .scc_type = MAC_SCC_QUADRA,
444 .ether_type = MAC_ETHER_SONIC,
445 .nubus_type = MAC_NUBUS
447 /* The Q700 does have a NS Sonic */
449 .ident = MAC_MODEL_Q700,
450 .name = "Quadra 700",
451 .adb_type = MAC_ADB_II,
452 .via_type = MAC_VIA_QUADRA,
453 .scsi_type = MAC_SCSI_QUADRA2,
454 .scc_type = MAC_SCC_QUADRA,
455 .ether_type = MAC_ETHER_SONIC,
456 .nubus_type = MAC_NUBUS
458 .ident = MAC_MODEL_Q800,
459 .name = "Quadra 800",
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,
465 .nubus_type = MAC_NUBUS
467 .ident = MAC_MODEL_Q840,
468 .name = "Quadra 840AV",
469 .adb_type = MAC_ADB_CUDA,
470 .via_type = MAC_VIA_QUADRA,
471 .scsi_type = MAC_SCSI_QUADRA3,
472 .scc_type = MAC_SCC_PSC,
473 .ether_type = MAC_ETHER_MACE,
474 .nubus_type = MAC_NUBUS
476 .ident = MAC_MODEL_Q900,
477 .name = "Quadra 900",
478 .adb_type = MAC_ADB_IOP,
479 .via_type = MAC_VIA_QUADRA,
480 .scsi_type = MAC_SCSI_QUADRA2,
481 .scc_type = MAC_SCC_IOP,
482 .ether_type = MAC_ETHER_SONIC,
483 .nubus_type = MAC_NUBUS
485 .ident = MAC_MODEL_Q950,
486 .name = "Quadra 950",
487 .adb_type = MAC_ADB_IOP,
488 .via_type = MAC_VIA_QUADRA,
489 .scsi_type = MAC_SCSI_QUADRA2,
490 .scc_type = MAC_SCC_IOP,
491 .ether_type = MAC_ETHER_SONIC,
492 .nubus_type = MAC_NUBUS
496 * Performa - more LC type machines
500 .ident = MAC_MODEL_P460,
501 .name = "Performa 460",
502 .adb_type = MAC_ADB_IISI,
503 .via_type = MAC_VIA_IIci,
504 .scsi_type = MAC_SCSI_OLD,
505 .scc_type = MAC_SCC_II,
506 .nubus_type = MAC_NUBUS
508 .ident = MAC_MODEL_P475,
509 .name = "Performa 475",
510 .adb_type = MAC_ADB_CUDA,
511 .via_type = MAC_VIA_QUADRA,
512 .scsi_type = MAC_SCSI_QUADRA,
513 .scc_type = MAC_SCC_II,
514 .nubus_type = MAC_NUBUS
516 .ident = MAC_MODEL_P475F,
517 .name = "Performa 475",
518 .adb_type = MAC_ADB_CUDA,
519 .via_type = MAC_VIA_QUADRA,
520 .scsi_type = MAC_SCSI_QUADRA,
521 .scc_type = MAC_SCC_II,
522 .nubus_type = MAC_NUBUS
524 .ident = MAC_MODEL_P520,
525 .name = "Performa 520",
526 .adb_type = MAC_ADB_CUDA,
527 .via_type = MAC_VIA_IIci,
528 .scsi_type = MAC_SCSI_OLD,
529 .scc_type = MAC_SCC_II,
530 .nubus_type = MAC_NUBUS
532 .ident = MAC_MODEL_P550,
533 .name = "Performa 550",
534 .adb_type = MAC_ADB_CUDA,
535 .via_type = MAC_VIA_IIci,
536 .scsi_type = MAC_SCSI_OLD,
537 .scc_type = MAC_SCC_II,
538 .nubus_type = MAC_NUBUS
540 /* These have the comm slot, and therefore the possibility of SONIC ethernet */
542 .ident = MAC_MODEL_P575,
543 .name = "Performa 575",
544 .adb_type = MAC_ADB_CUDA,
545 .via_type = MAC_VIA_QUADRA,
546 .scsi_type = MAC_SCSI_QUADRA,
547 .scc_type = MAC_SCC_II,
548 .ether_type = MAC_ETHER_SONIC,
549 .nubus_type = MAC_NUBUS
551 .ident = MAC_MODEL_P588,
552 .name = "Performa 588",
553 .adb_type = MAC_ADB_CUDA,
554 .via_type = MAC_VIA_QUADRA,
555 .scsi_type = MAC_SCSI_QUADRA,
556 .ide_type = MAC_IDE_QUADRA,
557 .scc_type = MAC_SCC_II,
558 .ether_type = MAC_ETHER_SONIC,
559 .nubus_type = MAC_NUBUS
561 .ident = MAC_MODEL_TV,
563 .adb_type = MAC_ADB_CUDA,
564 .via_type = MAC_VIA_QUADRA,
565 .scsi_type = MAC_SCSI_OLD,
566 .scc_type = MAC_SCC_II,
567 .nubus_type = MAC_NUBUS
569 .ident = MAC_MODEL_P600,
570 .name = "Performa 600",
571 .adb_type = MAC_ADB_IISI,
572 .via_type = MAC_VIA_IIci,
573 .scsi_type = MAC_SCSI_OLD,
574 .scc_type = MAC_SCC_II,
575 .nubus_type = MAC_NUBUS
579 * Centris - just guessing again; maybe like Quadra
582 /* The C610 may or may not have SONIC. We probe to make sure */
584 .ident = MAC_MODEL_C610,
585 .name = "Centris 610",
586 .adb_type = MAC_ADB_II,
587 .via_type = MAC_VIA_QUADRA,
588 .scsi_type = MAC_SCSI_QUADRA,
589 .scc_type = MAC_SCC_QUADRA,
590 .ether_type = MAC_ETHER_SONIC,
591 .nubus_type = MAC_NUBUS
593 .ident = MAC_MODEL_C650,
594 .name = "Centris 650",
595 .adb_type = MAC_ADB_II,
596 .via_type = MAC_VIA_QUADRA,
597 .scsi_type = MAC_SCSI_QUADRA,
598 .scc_type = MAC_SCC_QUADRA,
599 .ether_type = MAC_ETHER_SONIC,
600 .nubus_type = MAC_NUBUS
602 .ident = MAC_MODEL_C660,
603 .name = "Centris 660AV",
604 .adb_type = MAC_ADB_CUDA,
605 .via_type = MAC_VIA_QUADRA,
606 .scsi_type = MAC_SCSI_QUADRA3,
607 .scc_type = MAC_SCC_PSC,
608 .ether_type = MAC_ETHER_MACE,
609 .nubus_type = MAC_NUBUS
613 * The PowerBooks all the same "Combo" custom IC for SCSI and SCC
614 * and a PMU (in two variations?) for ADB. Most of them use the
615 * Quadra-style VIAs. A few models also have IDE from hell.
619 .ident = MAC_MODEL_PB140,
620 .name = "PowerBook 140",
621 .adb_type = MAC_ADB_PB1,
622 .via_type = MAC_VIA_QUADRA,
623 .scsi_type = MAC_SCSI_OLD,
624 .scc_type = MAC_SCC_QUADRA,
625 .nubus_type = MAC_NUBUS
627 .ident = MAC_MODEL_PB145,
628 .name = "PowerBook 145",
629 .adb_type = MAC_ADB_PB1,
630 .via_type = MAC_VIA_QUADRA,
631 .scsi_type = MAC_SCSI_OLD,
632 .scc_type = MAC_SCC_QUADRA,
633 .nubus_type = MAC_NUBUS
635 .ident = MAC_MODEL_PB150,
636 .name = "PowerBook 150",
637 .adb_type = MAC_ADB_PB1,
638 .via_type = MAC_VIA_IIci,
639 .scsi_type = MAC_SCSI_OLD,
640 .ide_type = MAC_IDE_PB,
641 .scc_type = MAC_SCC_QUADRA,
642 .nubus_type = MAC_NUBUS
644 .ident = MAC_MODEL_PB160,
645 .name = "PowerBook 160",
646 .adb_type = MAC_ADB_PB1,
647 .via_type = MAC_VIA_QUADRA,
648 .scsi_type = MAC_SCSI_OLD,
649 .scc_type = MAC_SCC_QUADRA,
650 .nubus_type = MAC_NUBUS
652 .ident = MAC_MODEL_PB165,
653 .name = "PowerBook 165",
654 .adb_type = MAC_ADB_PB1,
655 .via_type = MAC_VIA_QUADRA,
656 .scsi_type = MAC_SCSI_OLD,
657 .scc_type = MAC_SCC_QUADRA,
658 .nubus_type = MAC_NUBUS
660 .ident = MAC_MODEL_PB165C,
661 .name = "PowerBook 165c",
662 .adb_type = MAC_ADB_PB1,
663 .via_type = MAC_VIA_QUADRA,
664 .scsi_type = MAC_SCSI_OLD,
665 .scc_type = MAC_SCC_QUADRA,
666 .nubus_type = MAC_NUBUS
668 .ident = MAC_MODEL_PB170,
669 .name = "PowerBook 170",
670 .adb_type = MAC_ADB_PB1,
671 .via_type = MAC_VIA_QUADRA,
672 .scsi_type = MAC_SCSI_OLD,
673 .scc_type = MAC_SCC_QUADRA,
674 .nubus_type = MAC_NUBUS
676 .ident = MAC_MODEL_PB180,
677 .name = "PowerBook 180",
678 .adb_type = MAC_ADB_PB1,
679 .via_type = MAC_VIA_QUADRA,
680 .scsi_type = MAC_SCSI_OLD,
681 .scc_type = MAC_SCC_QUADRA,
682 .nubus_type = MAC_NUBUS
684 .ident = MAC_MODEL_PB180C,
685 .name = "PowerBook 180c",
686 .adb_type = MAC_ADB_PB1,
687 .via_type = MAC_VIA_QUADRA,
688 .scsi_type = MAC_SCSI_OLD,
689 .scc_type = MAC_SCC_QUADRA,
690 .nubus_type = MAC_NUBUS
692 .ident = MAC_MODEL_PB190,
693 .name = "PowerBook 190",
694 .adb_type = MAC_ADB_PB2,
695 .via_type = MAC_VIA_QUADRA,
696 .scsi_type = MAC_SCSI_OLD,
697 .ide_type = MAC_IDE_BABOON,
698 .scc_type = MAC_SCC_QUADRA,
699 .nubus_type = MAC_NUBUS
701 .ident = MAC_MODEL_PB520,
702 .name = "PowerBook 520",
703 .adb_type = MAC_ADB_PB2,
704 .via_type = MAC_VIA_QUADRA,
705 .scsi_type = MAC_SCSI_OLD,
706 .scc_type = MAC_SCC_QUADRA,
707 .ether_type = MAC_ETHER_SONIC,
708 .nubus_type = MAC_NUBUS
712 * PowerBook Duos are pretty much like normal PowerBooks
713 * All of these probably have onboard SONIC in the Dock which
714 * means we'll have to probe for it eventually.
716 * Are these reallly MAC_VIA_IIci? The developer notes for the
717 * Duos show pretty much the same custom parts as in most of
718 * the other PowerBooks which would imply MAC_VIA_QUADRA.
722 .ident = MAC_MODEL_PB210,
723 .name = "PowerBook Duo 210",
724 .adb_type = MAC_ADB_PB2,
725 .via_type = MAC_VIA_IIci,
726 .scsi_type = MAC_SCSI_OLD,
727 .scc_type = MAC_SCC_QUADRA,
728 .nubus_type = MAC_NUBUS
730 .ident = MAC_MODEL_PB230,
731 .name = "PowerBook Duo 230",
732 .adb_type = MAC_ADB_PB2,
733 .via_type = MAC_VIA_IIci,
734 .scsi_type = MAC_SCSI_OLD,
735 .scc_type = MAC_SCC_QUADRA,
736 .nubus_type = MAC_NUBUS
738 .ident = MAC_MODEL_PB250,
739 .name = "PowerBook Duo 250",
740 .adb_type = MAC_ADB_PB2,
741 .via_type = MAC_VIA_IIci,
742 .scsi_type = MAC_SCSI_OLD,
743 .scc_type = MAC_SCC_QUADRA,
744 .nubus_type = MAC_NUBUS
746 .ident = MAC_MODEL_PB270C,
747 .name = "PowerBook Duo 270c",
748 .adb_type = MAC_ADB_PB2,
749 .via_type = MAC_VIA_IIci,
750 .scsi_type = MAC_SCSI_OLD,
751 .scc_type = MAC_SCC_QUADRA,
752 .nubus_type = MAC_NUBUS
754 .ident = MAC_MODEL_PB280,
755 .name = "PowerBook Duo 280",
756 .adb_type = MAC_ADB_PB2,
757 .via_type = MAC_VIA_IIci,
758 .scsi_type = MAC_SCSI_OLD,
759 .scc_type = MAC_SCC_QUADRA,
760 .nubus_type = MAC_NUBUS
762 .ident = MAC_MODEL_PB280C,
763 .name = "PowerBook Duo 280c",
764 .adb_type = MAC_ADB_PB2,
765 .via_type = MAC_VIA_IIci,
766 .scsi_type = MAC_SCSI_OLD,
767 .scc_type = MAC_SCC_QUADRA,
768 .nubus_type = MAC_NUBUS
779 void mac_identify(void)
783 /* Penguin data useful? */
784 int model = mac_bi_data.id;
786 /* no bootinfo model id -> NetBSD booter was used! */
787 /* XXX FIXME: breaks for model > 31 */
788 model=(mac_bi_data.cpuid>>2)&63;
789 printk (KERN_WARNING "No bootinfo model ID, using cpuid instead (hey, use Penguin!)\n");
792 macintosh_config = mac_data_table;
793 for (m = macintosh_config ; m->ident != -1 ; m++) {
794 if (m->ident == model) {
795 macintosh_config = m;
800 /* We need to pre-init the IOPs, if any. Otherwise */
801 /* the serial console won't work if the user had */
802 /* the serial ports set to "Faster" mode in MacOS. */
807 printk (KERN_INFO "Detected Macintosh model: %d \n", model);
810 * Report booter data:
812 printk (KERN_DEBUG " Penguin bootinfo data:\n");
813 printk (KERN_DEBUG " Video: addr 0x%lx row 0x%lx depth %lx dimensions %ld x %ld\n",
814 mac_bi_data.videoaddr, mac_bi_data.videorow,
815 mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF,
816 mac_bi_data.dimensions >> 16);
817 printk (KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx \n",
818 mac_bi_data.videological, mac_orig_videoaddr,
819 mac_bi_data.sccbase);
820 printk (KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx \n",
821 mac_bi_data.boottime, mac_bi_data.gmtbias);
822 printk (KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx \n",
823 mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize);
825 printk ("Ramdisk: addr 0x%lx size 0x%lx\n",
826 m68k_ramdisk.addr, m68k_ramdisk.size);
830 * TODO: set the various fields in macintosh_config->hw_present here!
832 switch (macintosh_config->scsi_type) {
834 MACHW_SET(MAC_SCSI_80);
836 case MAC_SCSI_QUADRA:
837 case MAC_SCSI_QUADRA2:
838 case MAC_SCSI_QUADRA3:
839 MACHW_SET(MAC_SCSI_96);
840 if ((macintosh_config->ident == MAC_MODEL_Q900) ||
841 (macintosh_config->ident == MAC_MODEL_Q950))
842 MACHW_SET(MAC_SCSI_96_2);
845 printk(KERN_WARNING "config.c: wtf: unknown scsi, using 53c80\n");
846 MACHW_SET(MAC_SCSI_80);
857 void mac_report_hardware(void)
859 printk(KERN_INFO "Apple Macintosh %s\n", macintosh_config->name);
862 static void mac_get_model(char *str)
864 strcpy(str,"Macintosh ");
865 strcat(str, macintosh_config->name);