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 void mac_bang(int irq, void *vector, struct pt_regs *p)
94 printk(KERN_INFO "Resetting ...\n");
98 static void mac_sched_init(irqreturn_t (*vector)(int, void *, struct pt_regs *))
100 via_init_clock(vector);
104 void mac_waitbut (void)
110 extern irqreturn_t mac_default_handler(int, void *, struct pt_regs *);
112 irqreturn_t (*mac_handlers[8])(int, void *, struct pt_regs *)=
125 * Parse a Macintosh-specific record in the bootinfo
128 int __init mac_parse_bootinfo(const struct bi_record *record)
131 const u_long *data = record->data;
133 switch (record->tag) {
135 mac_bi_data.id = *data;
138 mac_bi_data.videoaddr = *data;
141 mac_bi_data.videodepth = *data;
144 mac_bi_data.videorow = *data;
147 mac_bi_data.dimensions = *data;
149 case BI_MAC_VLOGICAL:
150 mac_bi_data.videological = VIDEOMEMBASE + (*data & ~VIDEOMEMMASK);
151 mac_orig_videoaddr = *data;
154 mac_bi_data.sccbase = *data;
157 mac_bi_data.boottime = *data;
160 mac_bi_data.gmtbias = *data;
163 mac_bi_data.memsize = *data;
166 mac_bi_data.cpuid = *data;
169 mac_bi_data.rombase = *data;
178 * Flip into 24bit mode for an instant - flushes the L2 cache card. We
179 * have to disable interrupts for this. Our IRQ handlers will crap
180 * themselves if they take an IRQ in 24bit mode!
183 static void mac_cache_card_flush(int writeback)
186 local_irq_save(flags);
188 local_irq_restore(flags);
191 void __init config_mac(void)
194 printk(KERN_ERR "ERROR: no Mac, but config_mac() called!! \n");
197 mach_sched_init = mac_sched_init;
198 mach_init_IRQ = mac_init_IRQ;
199 mach_request_irq = mac_request_irq;
200 mach_free_irq = mac_free_irq;
201 enable_irq = mac_enable_irq;
202 disable_irq = mac_disable_irq;
203 mach_get_model = mac_get_model;
204 mach_default_handler = &mac_handlers;
205 mach_get_irq_list = show_mac_interrupts;
206 mach_gettimeoffset = mac_gettimeoffset;
207 #warning move to adb/via init
209 mach_hwclk = mac_hwclk;
211 mach_set_clock_mmss = mac_set_clock_mmss;
212 mach_reset = mac_reset;
213 mach_halt = mac_poweroff;
214 mach_power_off = mac_poweroff;
215 #ifdef CONFIG_DUMMY_CONSOLE
216 conswitchp = &dummy_con;
218 mach_max_dma_address = 0xffffffff;
220 mach_debug_init = mac_debug_init;
222 #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE)
223 mach_beep = mac_mksound;
225 #ifdef CONFIG_HEARTBEAT
227 mach_heartbeat = mac_heartbeat;
228 mach_heartbeat_irq = IRQ_MAC_TIMER;
233 * Determine hardware present
237 mac_report_hardware();
239 /* AFAIK only the IIci takes a cache card. The IIfx has onboard
240 cache ... someone needs to figure out how to tell if it's on or
243 if (macintosh_config->ident == MAC_MODEL_IICI
244 || macintosh_config->ident == MAC_MODEL_IIFX) {
245 mach_l2_flush = mac_cache_card_flush;
249 * Check for machine specific fixups.
252 #ifdef OLD_NUBUS_CODE
259 * Macintosh Table: hardcoded model configuration data.
261 * Much of this was defined by Alan, based on who knows what docs.
262 * I've added a lot more, and some of that was pure guesswork based
263 * on hardware pages present on the Mac web site. Possibly wildly
264 * inaccurate, so look here if a new Mac model won't run. Example: if
265 * a Mac crashes immediately after the VIA1 registers have been dumped
266 * to the screen, it probably died attempting to read DirB on a RBV.
267 * Meaning it should have MAC_VIA_IIci here :-)
270 struct mac_model *macintosh_config;
271 EXPORT_SYMBOL(macintosh_config);
273 static struct mac_model mac_data_table[]=
276 * We'll pretend to be a Macintosh II, that's pretty safe.
280 .ident = MAC_MODEL_II,
282 .adb_type = MAC_ADB_II,
283 .via_type = MAC_VIA_II,
284 .scsi_type = MAC_SCSI_OLD,
285 .scc_type = MAC_SCC_II,
286 .nubus_type = MAC_NUBUS
290 * Original MacII hardware
295 .ident = MAC_MODEL_II,
297 .adb_type = MAC_ADB_II,
298 .via_type = MAC_VIA_II,
299 .scsi_type = MAC_SCSI_OLD,
300 .scc_type = MAC_SCC_II,
301 .nubus_type = MAC_NUBUS
303 .ident = MAC_MODEL_IIX,
305 .adb_type = MAC_ADB_II,
306 .via_type = MAC_VIA_II,
307 .scsi_type = MAC_SCSI_OLD,
308 .scc_type = MAC_SCC_II,
309 .nubus_type = MAC_NUBUS
311 .ident = MAC_MODEL_IICX,
313 .adb_type = MAC_ADB_II,
314 .via_type = MAC_VIA_II,
315 .scsi_type = MAC_SCSI_OLD,
316 .scc_type = MAC_SCC_II,
317 .nubus_type = MAC_NUBUS
319 .ident = MAC_MODEL_SE30,
321 .adb_type = MAC_ADB_II,
322 .via_type = MAC_VIA_II,
323 .scsi_type = MAC_SCSI_OLD,
324 .scc_type = MAC_SCC_II,
325 .nubus_type = MAC_NUBUS
329 * Weirdified MacII hardware - all subtley different. Gee thanks
330 * Apple. All these boxes seem to have VIA2 in a different place to
331 * the MacII (+1A000 rather than +4000)
332 * CSA: see http://developer.apple.com/technotes/hw/hw_09.html
336 .ident = MAC_MODEL_IICI,
338 .adb_type = MAC_ADB_II,
339 .via_type = MAC_VIA_IIci,
340 .scsi_type = MAC_SCSI_OLD,
341 .scc_type = MAC_SCC_II,
342 .nubus_type = MAC_NUBUS
344 .ident = MAC_MODEL_IIFX,
346 .adb_type = MAC_ADB_IOP,
347 .via_type = MAC_VIA_IIci,
348 .scsi_type = MAC_SCSI_OLD,
349 .scc_type = MAC_SCC_IOP,
350 .nubus_type = MAC_NUBUS
352 .ident = MAC_MODEL_IISI,
354 .adb_type = MAC_ADB_IISI,
355 .via_type = MAC_VIA_IIci,
356 .scsi_type = MAC_SCSI_OLD,
357 .scc_type = MAC_SCC_II,
358 .nubus_type = MAC_NUBUS
360 .ident = MAC_MODEL_IIVI,
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
368 .ident = MAC_MODEL_IIVX,
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
378 * Classic models (guessing: similar to SE/30 ?? Nope, similar to LC ...)
382 .ident = MAC_MODEL_CLII,
383 .name = "Classic II",
384 .adb_type = MAC_ADB_IISI,
385 .via_type = MAC_VIA_IIci,
386 .scsi_type = MAC_SCSI_OLD,
387 .scc_type = MAC_SCC_II,
388 .nubus_type = MAC_NUBUS
390 .ident = MAC_MODEL_CCL,
391 .name = "Color Classic",
392 .adb_type = MAC_ADB_CUDA,
393 .via_type = MAC_VIA_IIci,
394 .scsi_type = MAC_SCSI_OLD,
395 .scc_type = MAC_SCC_II,
396 .nubus_type = MAC_NUBUS},
399 * Some Mac LC machines. Basically the same as the IIci, ADB like IIsi
403 .ident = MAC_MODEL_LC,
405 .adb_type = MAC_ADB_IISI,
406 .via_type = MAC_VIA_IIci,
407 .scsi_type = MAC_SCSI_OLD,
408 .scc_type = MAC_SCC_II,
409 .nubus_type = MAC_NUBUS
411 .ident = MAC_MODEL_LCII,
413 .adb_type = MAC_ADB_IISI,
414 .via_type = MAC_VIA_IIci,
415 .scsi_type = MAC_SCSI_OLD,
416 .scc_type = MAC_SCC_II,
417 .nubus_type = MAC_NUBUS
419 .ident = MAC_MODEL_LCIII,
421 .adb_type = MAC_ADB_IISI,
422 .via_type = MAC_VIA_IIci,
423 .scsi_type = MAC_SCSI_OLD,
424 .scc_type = MAC_SCC_II,
425 .nubus_type = MAC_NUBUS
429 * Quadra. Video is at 0xF9000000, via is like a MacII. We label it differently
430 * as some of the stuff connected to VIA2 seems different. Better SCSI chip and
431 * onboard ethernet using a NatSemi SONIC except the 660AV and 840AV which use an
433 * The 700, 900 and 950 have some I/O chips in the wrong place to
434 * confuse us. The 840AV has a SCSI location of its own (same as
439 .ident = MAC_MODEL_Q605,
440 .name = "Quadra 605",
441 .adb_type = MAC_ADB_CUDA,
442 .via_type = MAC_VIA_QUADRA,
443 .scsi_type = MAC_SCSI_QUADRA,
444 .scc_type = MAC_SCC_QUADRA,
445 .nubus_type = MAC_NUBUS
447 .ident = MAC_MODEL_Q605_ACC,
448 .name = "Quadra 605",
449 .adb_type = MAC_ADB_CUDA,
450 .via_type = MAC_VIA_QUADRA,
451 .scsi_type = MAC_SCSI_QUADRA,
452 .scc_type = MAC_SCC_QUADRA,
453 .nubus_type = MAC_NUBUS
455 .ident = MAC_MODEL_Q610,
456 .name = "Quadra 610",
457 .adb_type = MAC_ADB_II,
458 .via_type = MAC_VIA_QUADRA,
459 .scsi_type = MAC_SCSI_QUADRA,
460 .scc_type = MAC_SCC_QUADRA,
461 .ether_type = MAC_ETHER_SONIC,
462 .nubus_type = MAC_NUBUS
464 .ident = MAC_MODEL_Q630,
465 .name = "Quadra 630",
466 .adb_type = MAC_ADB_CUDA,
467 .via_type = MAC_VIA_QUADRA,
468 .scsi_type = MAC_SCSI_QUADRA,
469 .ide_type = MAC_IDE_QUADRA,
470 .scc_type = MAC_SCC_QUADRA,
471 .ether_type = MAC_ETHER_SONIC,
472 .nubus_type = MAC_NUBUS
474 .ident = MAC_MODEL_Q650,
475 .name = "Quadra 650",
476 .adb_type = MAC_ADB_II,
477 .via_type = MAC_VIA_QUADRA,
478 .scsi_type = MAC_SCSI_QUADRA,
479 .scc_type = MAC_SCC_QUADRA,
480 .ether_type = MAC_ETHER_SONIC,
481 .nubus_type = MAC_NUBUS
483 /* The Q700 does have a NS Sonic */
485 .ident = MAC_MODEL_Q700,
486 .name = "Quadra 700",
487 .adb_type = MAC_ADB_II,
488 .via_type = MAC_VIA_QUADRA,
489 .scsi_type = MAC_SCSI_QUADRA2,
490 .scc_type = MAC_SCC_QUADRA,
491 .ether_type = MAC_ETHER_SONIC,
492 .nubus_type = MAC_NUBUS
494 .ident = MAC_MODEL_Q800,
495 .name = "Quadra 800",
496 .adb_type = MAC_ADB_II,
497 .via_type = MAC_VIA_QUADRA,
498 .scsi_type = MAC_SCSI_QUADRA,
499 .scc_type = MAC_SCC_QUADRA,
500 .ether_type = MAC_ETHER_SONIC,
501 .nubus_type = MAC_NUBUS
503 .ident = MAC_MODEL_Q840,
504 .name = "Quadra 840AV",
505 .adb_type = MAC_ADB_CUDA,
506 .via_type = MAC_VIA_QUADRA,
507 .scsi_type = MAC_SCSI_QUADRA3,
508 .scc_type = MAC_SCC_PSC,
509 .ether_type = MAC_ETHER_MACE,
510 .nubus_type = MAC_NUBUS
512 .ident = MAC_MODEL_Q900,
513 .name = "Quadra 900",
514 .adb_type = MAC_ADB_IOP,
515 .via_type = MAC_VIA_QUADRA,
516 .scsi_type = MAC_SCSI_QUADRA2,
517 .scc_type = MAC_SCC_IOP,
518 .ether_type = MAC_ETHER_SONIC,
519 .nubus_type = MAC_NUBUS
521 .ident = MAC_MODEL_Q950,
522 .name = "Quadra 950",
523 .adb_type = MAC_ADB_IOP,
524 .via_type = MAC_VIA_QUADRA,
525 .scsi_type = MAC_SCSI_QUADRA2,
526 .scc_type = MAC_SCC_IOP,
527 .ether_type = MAC_ETHER_SONIC,
528 .nubus_type = MAC_NUBUS
532 * Performa - more LC type machines
536 .ident = MAC_MODEL_P460,
537 .name = "Performa 460",
538 .adb_type = MAC_ADB_IISI,
539 .via_type = MAC_VIA_IIci,
540 .scsi_type = MAC_SCSI_OLD,
541 .scc_type = MAC_SCC_II,
542 .nubus_type = MAC_NUBUS
544 .ident = MAC_MODEL_P475,
545 .name = "Performa 475",
546 .adb_type = MAC_ADB_CUDA,
547 .via_type = MAC_VIA_QUADRA,
548 .scsi_type = MAC_SCSI_QUADRA,
549 .scc_type = MAC_SCC_II,
550 .nubus_type = MAC_NUBUS
552 .ident = MAC_MODEL_P475F,
553 .name = "Performa 475",
554 .adb_type = MAC_ADB_CUDA,
555 .via_type = MAC_VIA_QUADRA,
556 .scsi_type = MAC_SCSI_QUADRA,
557 .scc_type = MAC_SCC_II,
558 .nubus_type = MAC_NUBUS
560 .ident = MAC_MODEL_P520,
561 .name = "Performa 520",
562 .adb_type = MAC_ADB_CUDA,
563 .via_type = MAC_VIA_IIci,
564 .scsi_type = MAC_SCSI_OLD,
565 .scc_type = MAC_SCC_II,
566 .nubus_type = MAC_NUBUS
568 .ident = MAC_MODEL_P550,
569 .name = "Performa 550",
570 .adb_type = MAC_ADB_CUDA,
571 .via_type = MAC_VIA_IIci,
572 .scsi_type = MAC_SCSI_OLD,
573 .scc_type = MAC_SCC_II,
574 .nubus_type = MAC_NUBUS
576 /* These have the comm slot, and therefore the possibility of SONIC ethernet */
578 .ident = MAC_MODEL_P575,
579 .name = "Performa 575",
580 .adb_type = MAC_ADB_CUDA,
581 .via_type = MAC_VIA_QUADRA,
582 .scsi_type = MAC_SCSI_QUADRA,
583 .scc_type = MAC_SCC_II,
584 .ether_type = MAC_ETHER_SONIC,
585 .nubus_type = MAC_NUBUS
587 .ident = MAC_MODEL_P588,
588 .name = "Performa 588",
589 .adb_type = MAC_ADB_CUDA,
590 .via_type = MAC_VIA_QUADRA,
591 .scsi_type = MAC_SCSI_QUADRA,
592 .ide_type = MAC_IDE_QUADRA,
593 .scc_type = MAC_SCC_II,
594 .ether_type = MAC_ETHER_SONIC,
595 .nubus_type = MAC_NUBUS
597 .ident = MAC_MODEL_TV,
599 .adb_type = MAC_ADB_CUDA,
600 .via_type = MAC_VIA_QUADRA,
601 .scsi_type = MAC_SCSI_OLD,
602 .scc_type = MAC_SCC_II,
603 .nubus_type = MAC_NUBUS
605 .ident = MAC_MODEL_P600,
606 .name = "Performa 600",
607 .adb_type = MAC_ADB_IISI,
608 .via_type = MAC_VIA_IIci,
609 .scsi_type = MAC_SCSI_OLD,
610 .scc_type = MAC_SCC_II,
611 .nubus_type = MAC_NUBUS
615 * Centris - just guessing again; maybe like Quadra
618 /* The C610 may or may not have SONIC. We probe to make sure */
620 .ident = MAC_MODEL_C610,
621 .name = "Centris 610",
622 .adb_type = MAC_ADB_II,
623 .via_type = MAC_VIA_QUADRA,
624 .scsi_type = MAC_SCSI_QUADRA,
625 .scc_type = MAC_SCC_QUADRA,
626 .ether_type = MAC_ETHER_SONIC,
627 .nubus_type = MAC_NUBUS
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,
636 .nubus_type = MAC_NUBUS
638 .ident = MAC_MODEL_C660,
639 .name = "Centris 660AV",
640 .adb_type = MAC_ADB_CUDA,
641 .via_type = MAC_VIA_QUADRA,
642 .scsi_type = MAC_SCSI_QUADRA3,
643 .scc_type = MAC_SCC_PSC,
644 .ether_type = MAC_ETHER_MACE,
645 .nubus_type = MAC_NUBUS
649 * The PowerBooks all the same "Combo" custom IC for SCSI and SCC
650 * and a PMU (in two variations?) for ADB. Most of them use the
651 * Quadra-style VIAs. A few models also have IDE from hell.
655 .ident = MAC_MODEL_PB140,
656 .name = "PowerBook 140",
657 .adb_type = MAC_ADB_PB1,
658 .via_type = MAC_VIA_QUADRA,
659 .scsi_type = MAC_SCSI_OLD,
660 .scc_type = MAC_SCC_QUADRA,
661 .nubus_type = MAC_NUBUS
663 .ident = MAC_MODEL_PB145,
664 .name = "PowerBook 145",
665 .adb_type = MAC_ADB_PB1,
666 .via_type = MAC_VIA_QUADRA,
667 .scsi_type = MAC_SCSI_OLD,
668 .scc_type = MAC_SCC_QUADRA,
669 .nubus_type = MAC_NUBUS
671 .ident = MAC_MODEL_PB150,
672 .name = "PowerBook 150",
673 .adb_type = MAC_ADB_PB1,
674 .via_type = MAC_VIA_IIci,
675 .scsi_type = MAC_SCSI_OLD,
676 .ide_type = MAC_IDE_PB,
677 .scc_type = MAC_SCC_QUADRA,
678 .nubus_type = MAC_NUBUS
680 .ident = MAC_MODEL_PB160,
681 .name = "PowerBook 160",
682 .adb_type = MAC_ADB_PB1,
683 .via_type = MAC_VIA_QUADRA,
684 .scsi_type = MAC_SCSI_OLD,
685 .scc_type = MAC_SCC_QUADRA,
686 .nubus_type = MAC_NUBUS
688 .ident = MAC_MODEL_PB165,
689 .name = "PowerBook 165",
690 .adb_type = MAC_ADB_PB1,
691 .via_type = MAC_VIA_QUADRA,
692 .scsi_type = MAC_SCSI_OLD,
693 .scc_type = MAC_SCC_QUADRA,
694 .nubus_type = MAC_NUBUS
696 .ident = MAC_MODEL_PB165C,
697 .name = "PowerBook 165c",
698 .adb_type = MAC_ADB_PB1,
699 .via_type = MAC_VIA_QUADRA,
700 .scsi_type = MAC_SCSI_OLD,
701 .scc_type = MAC_SCC_QUADRA,
702 .nubus_type = MAC_NUBUS
704 .ident = MAC_MODEL_PB170,
705 .name = "PowerBook 170",
706 .adb_type = MAC_ADB_PB1,
707 .via_type = MAC_VIA_QUADRA,
708 .scsi_type = MAC_SCSI_OLD,
709 .scc_type = MAC_SCC_QUADRA,
710 .nubus_type = MAC_NUBUS
712 .ident = MAC_MODEL_PB180,
713 .name = "PowerBook 180",
714 .adb_type = MAC_ADB_PB1,
715 .via_type = MAC_VIA_QUADRA,
716 .scsi_type = MAC_SCSI_OLD,
717 .scc_type = MAC_SCC_QUADRA,
718 .nubus_type = MAC_NUBUS
720 .ident = MAC_MODEL_PB180C,
721 .name = "PowerBook 180c",
722 .adb_type = MAC_ADB_PB1,
723 .via_type = MAC_VIA_QUADRA,
724 .scsi_type = MAC_SCSI_OLD,
725 .scc_type = MAC_SCC_QUADRA,
726 .nubus_type = MAC_NUBUS
728 .ident = MAC_MODEL_PB190,
729 .name = "PowerBook 190",
730 .adb_type = MAC_ADB_PB2,
731 .via_type = MAC_VIA_QUADRA,
732 .scsi_type = MAC_SCSI_OLD,
733 .ide_type = MAC_IDE_BABOON,
734 .scc_type = MAC_SCC_QUADRA,
735 .nubus_type = MAC_NUBUS
737 .ident = MAC_MODEL_PB520,
738 .name = "PowerBook 520",
739 .adb_type = MAC_ADB_PB2,
740 .via_type = MAC_VIA_QUADRA,
741 .scsi_type = MAC_SCSI_OLD,
742 .scc_type = MAC_SCC_QUADRA,
743 .ether_type = MAC_ETHER_SONIC,
744 .nubus_type = MAC_NUBUS
748 * PowerBook Duos are pretty much like normal PowerBooks
749 * All of these probably have onboard SONIC in the Dock which
750 * means we'll have to probe for it eventually.
752 * Are these reallly MAC_VIA_IIci? The developer notes for the
753 * Duos show pretty much the same custom parts as in most of
754 * the other PowerBooks which would imply MAC_VIA_QUADRA.
758 .ident = MAC_MODEL_PB210,
759 .name = "PowerBook Duo 210",
760 .adb_type = MAC_ADB_PB2,
761 .via_type = MAC_VIA_IIci,
762 .scsi_type = MAC_SCSI_OLD,
763 .scc_type = MAC_SCC_QUADRA,
764 .nubus_type = MAC_NUBUS
766 .ident = MAC_MODEL_PB230,
767 .name = "PowerBook Duo 230",
768 .adb_type = MAC_ADB_PB2,
769 .via_type = MAC_VIA_IIci,
770 .scsi_type = MAC_SCSI_OLD,
771 .scc_type = MAC_SCC_QUADRA,
772 .nubus_type = MAC_NUBUS
774 .ident = MAC_MODEL_PB250,
775 .name = "PowerBook Duo 250",
776 .adb_type = MAC_ADB_PB2,
777 .via_type = MAC_VIA_IIci,
778 .scsi_type = MAC_SCSI_OLD,
779 .scc_type = MAC_SCC_QUADRA,
780 .nubus_type = MAC_NUBUS
782 .ident = MAC_MODEL_PB270C,
783 .name = "PowerBook Duo 270c",
784 .adb_type = MAC_ADB_PB2,
785 .via_type = MAC_VIA_IIci,
786 .scsi_type = MAC_SCSI_OLD,
787 .scc_type = MAC_SCC_QUADRA,
788 .nubus_type = MAC_NUBUS
790 .ident = MAC_MODEL_PB280,
791 .name = "PowerBook Duo 280",
792 .adb_type = MAC_ADB_PB2,
793 .via_type = MAC_VIA_IIci,
794 .scsi_type = MAC_SCSI_OLD,
795 .scc_type = MAC_SCC_QUADRA,
796 .nubus_type = MAC_NUBUS
798 .ident = MAC_MODEL_PB280C,
799 .name = "PowerBook Duo 280c",
800 .adb_type = MAC_ADB_PB2,
801 .via_type = MAC_VIA_IIci,
802 .scsi_type = MAC_SCSI_OLD,
803 .scc_type = MAC_SCC_QUADRA,
804 .nubus_type = MAC_NUBUS
815 void mac_identify(void)
819 /* Penguin data useful? */
820 int model = mac_bi_data.id;
822 /* no bootinfo model id -> NetBSD booter was used! */
823 /* XXX FIXME: breaks for model > 31 */
824 model=(mac_bi_data.cpuid>>2)&63;
825 printk (KERN_WARNING "No bootinfo model ID, using cpuid instead (hey, use Penguin!)\n");
828 macintosh_config = mac_data_table;
829 for (m = macintosh_config ; m->ident != -1 ; m++) {
830 if (m->ident == model) {
831 macintosh_config = m;
836 /* We need to pre-init the IOPs, if any. Otherwise */
837 /* the serial console won't work if the user had */
838 /* the serial ports set to "Faster" mode in MacOS. */
843 printk (KERN_INFO "Detected Macintosh model: %d \n", model);
846 * Report booter data:
848 printk (KERN_DEBUG " Penguin bootinfo data:\n");
849 printk (KERN_DEBUG " Video: addr 0x%lx row 0x%lx depth %lx dimensions %ld x %ld\n",
850 mac_bi_data.videoaddr, mac_bi_data.videorow,
851 mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF,
852 mac_bi_data.dimensions >> 16);
853 printk (KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx \n",
854 mac_bi_data.videological, mac_orig_videoaddr,
855 mac_bi_data.sccbase);
856 printk (KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx \n",
857 mac_bi_data.boottime, mac_bi_data.gmtbias);
858 printk (KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx \n",
859 mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize);
861 printk ("Ramdisk: addr 0x%lx size 0x%lx\n",
862 m68k_ramdisk.addr, m68k_ramdisk.size);
866 * TODO: set the various fields in macintosh_config->hw_present here!
868 switch (macintosh_config->scsi_type) {
870 MACHW_SET(MAC_SCSI_80);
872 case MAC_SCSI_QUADRA:
873 case MAC_SCSI_QUADRA2:
874 case MAC_SCSI_QUADRA3:
875 MACHW_SET(MAC_SCSI_96);
876 if ((macintosh_config->ident == MAC_MODEL_Q900) ||
877 (macintosh_config->ident == MAC_MODEL_Q950))
878 MACHW_SET(MAC_SCSI_96_2);
881 printk(KERN_WARNING "config.c: wtf: unknown scsi, using 53c80\n");
882 MACHW_SET(MAC_SCSI_80);
893 void mac_report_hardware(void)
895 printk(KERN_INFO "Apple Macintosh %s\n", macintosh_config->name);
898 static void mac_get_model(char *str)
900 strcpy(str,"Macintosh ");
901 strcat(str, macintosh_config->name);