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/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>
26 #define BOOTINFO_COMPAT_1_0
27 #include <asm/setup.h>
28 #include <asm/bootinfo.h>
30 #include <asm/system.h>
33 #include <asm/pgtable.h>
34 #include <asm/machdep.h>
36 #include <asm/macintosh.h>
37 #include <asm/macints.h>
38 #include <asm/machw.h>
42 /* Mac bootinfo struct */
44 struct mac_booter_data mac_bi_data
= {0,};
45 int mac_bisize
= sizeof mac_bi_data
;
47 /* New m68k bootinfo stuff and videobase */
49 extern int m68k_num_memory
;
50 extern struct mem_info m68k_memory
[NUM_MEMINFO
];
52 extern struct mem_info m68k_ramdisk
;
54 extern char m68k_command_line
[CL_SIZE
];
56 void *mac_env
; /* Loaded by the boot asm */
58 /* The logical video addr. determined by head.S - testing */
59 extern unsigned long mac_videobase
;
61 /* The phys. video addr. - might be bogus on some machines */
62 unsigned long mac_orig_videoaddr
;
64 /* Mac specific keyboard functions */
65 extern int mac_keyb_init(void);
66 extern int mac_kbdrate(struct kbd_repeat
*k
);
67 extern void mac_kbd_leds(unsigned int leds
);
68 extern void mac_kbd_reset_setup(char*, int);
70 /* Mac specific irq functions */
71 extern void mac_init_IRQ (void);
72 extern void (*mac_handlers
[]) (int, void *, struct pt_regs
*);
73 extern int mac_request_irq (unsigned int irq
,
74 void (*handler
)(int, void *, struct pt_regs
*),
75 unsigned long flags
, const char *devname
,
77 extern void mac_free_irq (unsigned int irq
, void *dev_id
);
78 extern void mac_enable_irq (unsigned int);
79 extern void mac_disable_irq (unsigned int);
80 static void mac_get_model(char *model
);
81 /*static int mac_get_hardware_list(char *buffer);*/
82 extern int mac_get_irq_list (char *);
84 /* Mac specific timer functions */
85 extern unsigned long mac_gettimeoffset (void);
86 extern void mac_gettod (int *, int *, int *, int *, int *, int *);
87 extern int mac_hwclk (int, struct hwclk_time
*);
88 extern int mac_set_clock_mmss (unsigned long);
89 extern void via_init_clock(void (*func
)(int, void *, struct pt_regs
*));
91 extern void (*kd_mksound
)(unsigned int, unsigned int);
92 extern void mac_mksound(unsigned int, unsigned int);
93 extern int mac_floppy_init(void);
94 extern void mac_floppy_setup(char *,int *);
96 extern void nubus_sweep_video(void);
98 /* Mac specific debug functions (in debug.c) */
99 extern void mac_debug_init(void);
100 extern void mac_debugging_long(int, long);
102 #ifdef CONFIG_MAGIC_SYSRQ
104 /* XXX FIXME: Atari scancodes still */
105 static char mac_sysrq_xlate
[128] =
106 "\000\0331234567890-=\177\t" /* 0x00 - 0x0f */
107 "qwertyuiop[]\r\000as" /* 0x10 - 0x1f */
108 "dfghjkl;'`\000\\zxcv" /* 0x20 - 0x2f */
109 "bnm,./\000\000\000 \000\201\202\203\204\205" /* 0x30 - 0x3f */
110 "\206\207\210\211\212\000\000\000\000\000-\000\000\000+\000"/* 0x40 - 0x4f */
111 "\000\000\000\177\000\000\000\000\000\000\000\000\000\000\000\000" /* 0x50 - 0x5f */
112 "\000\000\000()/*789456123" /* 0x60 - 0x6f */
113 "0.\r\000\000\000\000\000\000\000\000\000\000\000\000\000"; /* 0x70 - 0x7f */
116 extern void (*kd_mksound
)(unsigned int, unsigned int);
118 static void mac_get_model(char *str
);
120 void mac_bang(int irq
, void *vector
, struct pt_regs
*p
)
122 printk("Resetting ...\n");
126 void mac_sched_init(void (*vector
)(int, void *, struct pt_regs
*))
128 via_init_clock(vector
);
131 extern int console_loglevel
;
134 * This function translates the boot timeval into a proper date, to initialize
138 void mac_gettod (int *yearp
, int *monp
, int *dayp
,
139 int *hourp
, int *minp
, int *secp
)
142 int leap
, oldleap
, isleap
;
143 int mon_days
[14] = { -1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, -1 };
145 time
= mac_bi_data
.boottime
- 60*mac_bi_data
.gmtbias
; /* seconds */
148 *secp
= time
- (*minp
* 60);
149 time
= *minp
; /* minutes now */
152 *minp
= time
- (*hourp
* 60);
153 time
= *hourp
; /* hours now */
156 *hourp
= time
- (*dayp
* 24);
157 time
= *dayp
; /* days now ... */
159 /* for leap day calculation */
160 *yearp
= (time
/ 365) + 1970; /* approx. year */
162 /* leap year calculation - there's an easier way, I bet. And it's broken :-( */
163 /* calculate leap days up to previous year */
164 oldleap
= (*yearp
-1)/4 - (*yearp
-1)/100 + (*yearp
-1)/400;
165 /* calculate leap days incl. this year */
166 leap
= *yearp
/4 - *yearp
/100 + *yearp
/400;
167 /* this year a leap year ?? */
168 isleap
= (leap
!= oldleap
);
170 /* adjust days: days, excluding past leap days since epoch */
171 time
-= oldleap
- (1970/4 - 1970/100 + 1970/400);
173 /* precise year, and day in year */
174 *yearp
= (time
/ 365); /* #years since epoch */
175 *dayp
= time
- (*yearp
* 365) + 1; /* #days this year (0: Jan 1) */
176 *yearp
+= 70; /* add epoch :-) */
179 if (isleap
) /* add leap day ?? */
182 /* count the months */
183 for (*monp
= 1; time
> mon_days
[*monp
]; (*monp
)++)
184 time
-= mon_days
[*monp
];
192 * TBI: read and write hwclock
195 int mac_hwclk( int op
, struct hwclk_time
*t
)
201 * TBI: set minutes/seconds in hwclock
204 int mac_set_clock_mmss (unsigned long nowtime
)
206 short real_seconds
= nowtime
% 60, real_minutes
= (nowtime
/ 60) % 60;
211 void mac_waitbut (void)
216 extern struct consw fb_con
;
217 extern struct fb_info
*mac_fb_init(long *);
218 extern void mac_video_setup(char *, int *);
220 void (*mac_handlers
[8])(int, void *, struct pt_regs
*)=
233 * Parse a Macintosh-specific record in the bootinfo
236 __initfunc(int mac_parse_bootinfo(const struct bi_record
*record
))
239 const u_long
*data
= record
->data
;
241 switch (record
->tag
) {
243 mac_bi_data
.id
= *data
;
246 /* save booter supplied videobase; use the one mapped in head.S! */
247 mac_orig_videoaddr
= *data
;
248 mac_bi_data
.videoaddr
= mac_videobase
;
251 mac_bi_data
.videodepth
= *data
;
254 mac_bi_data
.videorow
= *data
;
257 mac_bi_data
.dimensions
= *data
;
259 case BI_MAC_VLOGICAL
:
260 mac_bi_data
.videological
= *data
;
263 mac_bi_data
.sccbase
= *data
;
266 mac_bi_data
.boottime
= *data
;
269 mac_bi_data
.gmtbias
= *data
;
272 mac_bi_data
.memsize
= *data
;
275 mac_bi_data
.cpuid
= *data
;
283 __initfunc(void config_mac(void))
286 if (MACH_IS_ATARI
|| MACH_IS_AMIGA
) {
287 printk("ERROR: no Mac, but config_mac() called!! \n");
292 mach_sched_init
= mac_sched_init
;
293 mach_keyb_init
= mac_keyb_init
;
294 mach_kbdrate
= mac_kbdrate
;
295 mach_kbd_leds
= mac_kbd_leds
;
296 kbd_reset_setup
= mac_kbd_reset_setup
;
297 mach_init_IRQ
= mac_init_IRQ
;
298 mach_request_irq
= mac_request_irq
;
299 mach_free_irq
= mac_free_irq
;
300 enable_irq
= mac_enable_irq
;
301 disable_irq
= mac_disable_irq
;
303 mach_default_handler
= &mac_handlers
;
305 mach_get_model
= mac_get_model
;
306 mach_get_irq_list
= mac_get_irq_list
;
307 mach_gettimeoffset
= mac_gettimeoffset
;
308 mach_gettod
= mac_gettod
;
309 mach_hwclk
= mac_hwclk
;
310 mach_set_clock_mmss
= mac_set_clock_mmss
;
312 mach_mksound
= mac_mksound
;
314 mach_reset
= mac_reset
;
315 conswitchp
= &dummy_con
;
316 mach_max_dma_address
= 0xffffffff;
318 mach_debug_init
= mac_debug_init
;
319 mach_video_setup
= mac_video_setup
;
321 kd_mksound
= mac_mksound
;
322 #ifdef CONFIG_MAGIC_SYSRQ
323 mach_sysrq_key
= 98; /* HELP */
324 mach_sysrq_shift_state
= 8; /* Alt */
325 mach_sysrq_shift_mask
= 0xff; /* all modifiers except CapsLock */
326 mach_sysrq_xlate
= mac_sysrq_xlate
;
328 #ifdef CONFIG_HEARTBEAT
330 mach_heartbeat
= mac_heartbeat
;
331 mach_heartbeat_irq
= IRQ_MAC_TIMER
;
336 * Determine hardware present
340 mac_report_hardware();
342 /* goes on forever if timers broken */
343 #ifdef MAC_DEBUG_SOUND
344 mac_mksound(1000,10);
348 * Check for machine specific fixups.
357 * Macintosh Table: hardcoded model configuration data.
359 * Much of this was defined by Alan, based on who knows what docs.
360 * I've added a lot more, and some of that was pure guesswork based
361 * on hardware pages present on the Mac web site. Possibly wildly
362 * inaccurate, so look here if a new Mac model won't run. Example: if
363 * a Mac crashes immediately after the VIA1 registers have been dumped
364 * to the screen, it probably died attempting to read DirB on a RBV.
365 * Meaning it should have MAC_VIA_IIci here :-)
368 struct mac_model
*macintosh_config
;
370 static struct mac_model mac_data_table
[]=
373 * Original MacII hardware
377 { MAC_MODEL_II
, "II", MAC_ADB_II
, MAC_VIA_II
, MAC_SCSI_OLD
, MAC_IDE_NONE
, MAC_SCC_II
, MAC_NUBUS
},
378 { MAC_MODEL_IIX
, "IIx", MAC_ADB_II
, MAC_VIA_II
, MAC_SCSI_OLD
, MAC_IDE_NONE
, MAC_SCC_II
, MAC_NUBUS
},
379 { MAC_MODEL_IICX
, "IIcx", MAC_ADB_II
, MAC_VIA_II
, MAC_SCSI_OLD
, MAC_IDE_NONE
, MAC_SCC_II
, MAC_NUBUS
},
380 { MAC_MODEL_SE30
, "SE/30", MAC_ADB_II
, MAC_VIA_II
, MAC_SCSI_OLD
, MAC_IDE_NONE
, MAC_SCC_II
, MAC_NUBUS
},
383 * Weirdified MacII hardware - all subtley different. Gee thanks
384 * Apple. All these boxes seem to have VIA2 in a different place to
385 * the MacII (+1A000 rather than +4000)
387 * The IIfx apparently has different ADB hardware, and stuff
388 * so zany nobody knows how to drive it.
389 * Even so, with Marten's help we'll try to deal with it :-)
392 { MAC_MODEL_IICI
, "IIci", MAC_ADB_II
, MAC_VIA_IIci
, MAC_SCSI_OLD
, MAC_IDE_NONE
, MAC_SCC_II
, MAC_ETHER_NONE
, MAC_NUBUS
},
393 { MAC_MODEL_IIFX
, "IIfx", MAC_ADB_II
, MAC_VIA_IIci
, MAC_SCSI_OLD
, MAC_IDE_NONE
, MAC_SCC_II
, MAC_ETHER_NONE
, MAC_NUBUS
},
394 { MAC_MODEL_IISI
, "IIsi", MAC_ADB_IISI
, MAC_VIA_IIci
, MAC_SCSI_OLD
, MAC_IDE_NONE
, MAC_SCC_II
, MAC_ETHER_NONE
, MAC_NUBUS
},
395 { MAC_MODEL_IIVI
, "IIvi", MAC_ADB_IISI
, MAC_VIA_IIci
, MAC_SCSI_OLD
, MAC_IDE_NONE
, MAC_SCC_II
, MAC_ETHER_NONE
, MAC_NUBUS
},
396 { MAC_MODEL_IIVX
, "IIvx", MAC_ADB_IISI
, MAC_VIA_IIci
, MAC_SCSI_OLD
, MAC_IDE_NONE
, MAC_SCC_II
, MAC_ETHER_NONE
, MAC_NUBUS
},
399 * Classic models (guessing: similar to SE/30 ?? Nope, similar to LC ...)
402 { MAC_MODEL_CLII
, "Classic II", MAC_ADB_IISI
, MAC_VIA_IIci
, MAC_SCSI_OLD
, MAC_IDE_NONE
, MAC_SCC_II
, MAC_ETHER_NONE
, MAC_NUBUS
},
403 { MAC_MODEL_CCL
, "Color Classic", MAC_ADB_IISI
, MAC_VIA_IIci
, MAC_SCSI_OLD
, MAC_IDE_NONE
, MAC_SCC_II
, MAC_ETHER_NONE
, MAC_NUBUS
},
406 * Some Mac LC machines. Basically the same as the IIci, ADB like IIsi
409 { MAC_MODEL_LC
, "LC", MAC_ADB_IISI
, MAC_VIA_IIci
, MAC_SCSI_OLD
, MAC_IDE_NONE
, MAC_SCC_II
, MAC_ETHER_NONE
, MAC_NUBUS
},
410 { MAC_MODEL_LCII
, "LC II", MAC_ADB_IISI
, MAC_VIA_IIci
, MAC_SCSI_OLD
, MAC_IDE_NONE
, MAC_SCC_II
, MAC_ETHER_NONE
, MAC_NUBUS
},
411 { MAC_MODEL_LCIII
,"LC III", MAC_ADB_IISI
, MAC_VIA_IIci
, MAC_SCSI_OLD
, MAC_IDE_NONE
, MAC_SCC_II
, MAC_ETHER_NONE
, MAC_NUBUS
},
414 * Quadra (only 68030 ones will actually work!). Not much odd. Video is at
415 * 0xF9000000, via is like a MacII. We label it differently as some of the
416 * stuff connected to VIA2 seems different. Better SCSI chip and ???? onboard ethernet
417 * in all cases using a NatSemi SONIC. The 700, 900 and 950 have some I/O chips in the wrong
418 * place to confuse us. The 840AV seems to have a scsi location of its own
421 { MAC_MODEL_Q605
, "Quadra 605", MAC_ADB_CUDA
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA
, MAC_IDE_NONE
, MAC_SCC_QUADRA
, MAC_ETHER_SONIC
, MAC_NUBUS
},
422 { MAC_MODEL_Q610
, "Quadra 610", MAC_ADB_II
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA
, MAC_IDE_NONE
, MAC_SCC_QUADRA
, MAC_ETHER_SONIC
, MAC_NUBUS
},
423 { MAC_MODEL_Q630
, "Quadra 630", MAC_ADB_CUDA
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA
, MAC_IDE_QUADRA
, MAC_SCC_QUADRA
, MAC_ETHER_SONIC
, MAC_NUBUS
},
424 { MAC_MODEL_Q650
, "Quadra 650", MAC_ADB_II
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA
, MAC_IDE_NONE
, MAC_SCC_QUADRA
, MAC_ETHER_SONIC
, MAC_NUBUS
},
425 /* The Q700 does have a NS Sonic */
426 { MAC_MODEL_Q700
, "Quadra 700", MAC_ADB_II
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA2
, MAC_IDE_NONE
, MAC_SCC_QUADRA2
, MAC_ETHER_SONIC
, MAC_NUBUS
},
427 { MAC_MODEL_Q800
, "Quadra 800", MAC_ADB_II
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA
, MAC_IDE_NONE
, MAC_SCC_QUADRA
, MAC_ETHER_SONIC
, MAC_NUBUS
},
428 /* Does the 840AV have ethernet ??? documents seem to indicate its not quite a
429 Quadra in this respect ? */
430 { MAC_MODEL_Q840
, "Quadra 840AV", MAC_ADB_CUDA
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA3
, MAC_IDE_NONE
, MAC_SCC_II
, MAC_ETHER_NONE
, MAC_NUBUS
},
431 /* These might have IOP problems */
432 { MAC_MODEL_Q900
, "Quadra 900", MAC_ADB_IISI
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA2
, MAC_IDE_NONE
, MAC_SCC_IOP
, MAC_ETHER_SONIC
, MAC_NUBUS
},
433 { MAC_MODEL_Q950
, "Quadra 950", MAC_ADB_IISI
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA2
, MAC_IDE_NONE
, MAC_SCC_IOP
, MAC_ETHER_SONIC
, MAC_NUBUS
},
436 * Performa - more LC type machines
439 { MAC_MODEL_P460
, "Performa 460", MAC_ADB_IISI
, MAC_VIA_IIci
, MAC_SCSI_OLD
, MAC_IDE_NONE
, MAC_SCC_II
, MAC_ETHER_NONE
, MAC_NUBUS
},
440 { MAC_MODEL_P475
, "Performa 475", MAC_ADB_CUDA
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA
, MAC_IDE_NONE
, MAC_SCC_II
, MAC_ETHER_NONE
, MAC_NUBUS
},
441 { MAC_MODEL_P475F
, "Performa 475", MAC_ADB_CUDA
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA
, MAC_IDE_NONE
, MAC_SCC_II
, MAC_ETHER_NONE
, MAC_NUBUS
},
442 { MAC_MODEL_P520
, "Performa 520", MAC_ADB_CUDA
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA
, MAC_IDE_NONE
, MAC_SCC_II
, MAC_ETHER_NONE
, MAC_NUBUS
},
443 { MAC_MODEL_P550
, "Performa 550", MAC_ADB_CUDA
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA
, MAC_IDE_NONE
, MAC_SCC_II
, MAC_ETHER_NONE
, MAC_NUBUS
},
444 { MAC_MODEL_P575
, "Performa 575", MAC_ADB_CUDA
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA
, MAC_IDE_NONE
, MAC_SCC_II
, MAC_ETHER_NONE
, MAC_NUBUS
},
445 { MAC_MODEL_P588
, "Performa 588", MAC_ADB_CUDA
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA
, MAC_IDE_NONE
, MAC_SCC_II
, MAC_ETHER_NONE
, MAC_NUBUS
},
446 { MAC_MODEL_TV
, "TV", MAC_ADB_CUDA
, MAC_VIA_QUADRA
, MAC_SCSI_OLD
, MAC_IDE_NONE
, MAC_SCC_II
, MAC_ETHER_NONE
, MAC_NUBUS
},
447 { MAC_MODEL_P600
, "Performa 600", MAC_ADB_IISI
, MAC_VIA_IIci
, MAC_SCSI_OLD
, MAC_IDE_NONE
, MAC_SCC_II
, MAC_ETHER_NONE
, MAC_NUBUS
},
448 #if 0 /* other sources seem to suggest the P630/Q630/LC630 is more like LCIII */
449 { MAC_MODEL_P630
, "Performa 630", MAC_ADB_IISI
, MAC_VIA_IIci
, MAC_SCSI_OLD
, MAC_IDE_NONE
, MAC_SCC_II
, MAC_ETHER_NONE
, MAC_NUBUS
},
452 * Centris - just guessing again; maybe like Quadra
455 { MAC_MODEL_C610
, "Centris 610", MAC_ADB_II
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA
, MAC_IDE_NONE
, MAC_SCC_QUADRA
, MAC_ETHER_NONE
, MAC_NUBUS
},
456 { MAC_MODEL_C650
, "Centris 650", MAC_ADB_II
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA
, MAC_IDE_NONE
, MAC_SCC_QUADRA
, MAC_ETHER_NONE
, MAC_NUBUS
},
457 { MAC_MODEL_C660
, "Centris 660AV", MAC_ADB_CUDA
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA3
, MAC_IDE_NONE
, MAC_SCC_QUADRA
, MAC_ETHER_NONE
, MAC_NUBUS
},
460 * Power books - seem similar to early Quadras ? (most have 030 though)
463 { MAC_MODEL_PB140
, "PowerBook 140", MAC_ADB_PB1
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA
, MAC_IDE_NONE
, MAC_SCC_QUADRA
, MAC_ETHER_NONE
, MAC_NUBUS
},
464 { MAC_MODEL_PB145
, "PowerBook 145", MAC_ADB_PB1
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA
, MAC_IDE_NONE
, MAC_SCC_QUADRA
, MAC_ETHER_NONE
, MAC_NUBUS
},
465 /* The PB150 has IDE, and IIci style VIA */
466 { MAC_MODEL_PB150
, "PowerBook 150", MAC_ADB_PB1
, MAC_VIA_IIci
, MAC_SCSI_QUADRA
, MAC_IDE_PB
, MAC_SCC_QUADRA
, MAC_ETHER_NONE
, MAC_NUBUS
},
467 { MAC_MODEL_PB160
, "PowerBook 160", MAC_ADB_PB1
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA
, MAC_IDE_NONE
, MAC_SCC_QUADRA
, MAC_ETHER_NONE
, MAC_NUBUS
},
468 { MAC_MODEL_PB165
, "PowerBook 165", MAC_ADB_PB1
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA
, MAC_IDE_NONE
, MAC_SCC_QUADRA
, MAC_ETHER_NONE
, MAC_NUBUS
},
469 { MAC_MODEL_PB165C
, "PowerBook 165c", MAC_ADB_PB1
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA
, MAC_IDE_NONE
, MAC_SCC_QUADRA
, MAC_ETHER_NONE
, MAC_NUBUS
},
470 { MAC_MODEL_PB170
, "PowerBook 170", MAC_ADB_PB1
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA
, MAC_IDE_NONE
, MAC_SCC_QUADRA
, MAC_ETHER_NONE
, MAC_NUBUS
},
471 { MAC_MODEL_PB180
, "PowerBook 180", MAC_ADB_PB1
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA
, MAC_IDE_NONE
, MAC_SCC_QUADRA
, MAC_ETHER_NONE
, MAC_NUBUS
},
472 { MAC_MODEL_PB180C
, "PowerBook 180c", MAC_ADB_PB1
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA
, MAC_IDE_NONE
, MAC_SCC_QUADRA
, MAC_ETHER_NONE
, MAC_NUBUS
},
473 { MAC_MODEL_PB190
, "PowerBook 190cs", MAC_ADB_PB1
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA
, MAC_IDE_PB
, MAC_SCC_QUADRA
, MAC_ETHER_NONE
, MAC_NUBUS
},
474 { MAC_MODEL_PB520
, "PowerBook 520", MAC_ADB_PB2
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA
, MAC_IDE_NONE
, MAC_SCC_QUADRA
, MAC_ETHER_NONE
, MAC_NUBUS
},
477 * Power book Duos - similar to Power books, I hope
480 { MAC_MODEL_PB210
, "PowerBook Duo 210", MAC_ADB_PB2
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA
, MAC_IDE_NONE
, MAC_SCC_QUADRA
, MAC_ETHER_NONE
, MAC_NUBUS
},
481 { MAC_MODEL_PB230
, "PowerBook Duo 230", MAC_ADB_PB2
, MAC_VIA_IIci
, MAC_SCSI_OLD
, MAC_IDE_NONE
, MAC_SCC_QUADRA
, MAC_ETHER_NONE
, MAC_NUBUS
},
482 { MAC_MODEL_PB250
, "PowerBook Duo 250", MAC_ADB_PB2
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA
, MAC_IDE_NONE
, MAC_SCC_QUADRA
, MAC_ETHER_NONE
, MAC_NUBUS
},
483 { MAC_MODEL_PB270C
, "PowerBook Duo 270c", MAC_ADB_PB2
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA
, MAC_IDE_NONE
, MAC_SCC_QUADRA
, MAC_ETHER_NONE
, MAC_NUBUS
},
484 { MAC_MODEL_PB280
, "PowerBook Duo 280", MAC_ADB_PB2
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA
, MAC_IDE_NONE
, MAC_SCC_QUADRA
, MAC_ETHER_NONE
, MAC_NUBUS
},
485 { MAC_MODEL_PB280C
, "PowerBook Duo 280c", MAC_ADB_PB2
, MAC_VIA_QUADRA
, MAC_SCSI_QUADRA
, MAC_IDE_NONE
, MAC_SCC_QUADRA
, MAC_ETHER_NONE
, MAC_NUBUS
},
493 void mac_identify(void)
495 struct mac_model
*m
=&mac_data_table
[0];
497 /* Penguin data useful? */
498 int model
= mac_bi_data
.id
;
500 /* no bootinfo model id -> NetBSD booter was used! */
501 /* XXX FIXME: breaks for model > 31 */
502 model
=(mac_bi_data
.cpuid
>>2)&63;
503 printk ("No bootinfo model ID, using cpuid instead (hey, use Penguin!)\n");
506 printk ("Detected Macintosh model: %d \n", model
);
508 while(m
->ident
!= -1)
510 if(m
->ident
== model
)
516 printk("\nUnknown macintosh model %d, probably unsupported.\n",
518 model
= MAC_MODEL_Q800
;
519 printk("Defaulting to: Quadra800, model id %d\n", model
);
520 printk("Please report this case to linux-mac68k@wave.lm.com\n");
521 m
=&mac_data_table
[0];
522 while(m
->ident
!= -1)
524 if(m
->ident
== model
)
533 * Report booter data:
535 printk (" Penguin bootinfo data:\n");
536 printk (" Video: addr 0x%lx row 0x%lx depth %lx dimensions %ld x %ld\n",
537 mac_bi_data
.videoaddr
, mac_bi_data
.videorow
,
538 mac_bi_data
.videodepth
, (int) (mac_bi_data
.dimensions
& 0xFFFF),
539 (int) (mac_bi_data
.dimensions
>> 16));
540 printk (" Videological 0x%lx phys. 0x%lx, SCC at 0x%lx \n",
541 mac_bi_data
.videological
, mac_orig_videoaddr
,
542 mac_bi_data
.sccbase
);
543 printk (" Boottime: 0x%lx GMTBias: 0x%lx \n",
544 mac_bi_data
.boottime
, mac_bi_data
.gmtbias
);
545 printk (" Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx \n",
546 mac_bi_data
.id
, mac_bi_data
.cpuid
, mac_bi_data
.memsize
);
548 printk ("Ramdisk: addr 0x%lx size 0x%lx\n",
549 m68k_ramdisk
.addr
, m68k_ramdisk
.size
);
559 * TODO: set the various fields in macintosh_config->hw_present here!
561 switch (macintosh_config
->scsi_type
) {
563 MACHW_SET(MAC_SCSI_80
);
565 case MAC_SCSI_QUADRA
:
566 case MAC_SCSI_QUADRA2
:
567 case MAC_SCSI_QUADRA3
:
568 MACHW_SET(MAC_SCSI_96
);
569 if ((macintosh_config
->ident
== MAC_MODEL_Q900
) ||
570 (macintosh_config
->ident
== MAC_MODEL_Q950
))
571 MACHW_SET(MAC_SCSI_96_2
);
574 printk("config.c: wtf: unknown scsi, using 53c80\n");
575 MACHW_SET(MAC_SCSI_80
);
583 void mac_report_hardware(void)
585 printk("Apple Macintosh %s\n", macintosh_config
->name
);
588 static void mac_get_model(char *str
)
590 strcpy(str
,"Macintosh ");
591 strcat(str
, macintosh_config
->name
);