blob: 91245ade2290eb7748f7fdda02a9676a00071f60 [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>
Linus Torvalds1da177e2005-04-16 15:20:36 -070026
27#define BOOTINFO_COMPAT_1_0
28#include <asm/setup.h>
29#include <asm/bootinfo.h>
30
31#include <asm/system.h>
32#include <asm/io.h>
33#include <asm/irq.h>
34#include <asm/pgtable.h>
35#include <asm/rtc.h>
36#include <asm/machdep.h>
37
38#include <asm/macintosh.h>
39#include <asm/macints.h>
40#include <asm/machw.h>
41
42#include <asm/mac_iop.h>
43#include <asm/mac_via.h>
44#include <asm/mac_oss.h>
45#include <asm/mac_psc.h>
46
47/* Mac bootinfo struct */
Linus Torvalds1da177e2005-04-16 15:20:36 -070048struct mac_booter_data mac_bi_data;
Linus Torvalds1da177e2005-04-16 15:20:36 -070049
Linus Torvalds1da177e2005-04-16 15:20:36 -070050/* The phys. video addr. - might be bogus on some machines */
Adrian Bunk8dfbdf42008-07-17 21:16:25 +020051static unsigned long mac_orig_videoaddr;
Linus Torvalds1da177e2005-04-16 15:20:36 -070052
53/* Mac specific timer functions */
Roman Zippel6ff58012007-05-01 22:32:43 +020054extern unsigned long mac_gettimeoffset(void);
55extern int mac_hwclk(int, struct rtc_time *);
56extern int mac_set_clock_mmss(unsigned long);
Linus Torvalds1da177e2005-04-16 15:20:36 -070057extern void iop_preinit(void);
58extern void iop_init(void);
59extern void via_init(void);
David Howells40220c12006-10-09 12:19:47 +010060extern void via_init_clock(irq_handler_t func);
Linus Torvalds1da177e2005-04-16 15:20:36 -070061extern void via_flush_cache(void);
62extern void oss_init(void);
63extern void psc_init(void);
64extern void baboon_init(void);
65
66extern void mac_mksound(unsigned int, unsigned int);
67
Linus Torvalds1da177e2005-04-16 15:20:36 -070068static void mac_get_model(char *str);
Adrian Bunk8dfbdf42008-07-17 21:16:25 +020069static void mac_identify(void);
70static void mac_report_hardware(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070071
Al Viro66a3f822007-07-20 04:33:28 +010072static void __init mac_sched_init(irq_handler_t vector)
Linus Torvalds1da177e2005-04-16 15:20:36 -070073{
74 via_init_clock(vector);
75}
76
Linus Torvalds1da177e2005-04-16 15:20:36 -070077/*
78 * Parse a Macintosh-specific record in the bootinfo
79 */
80
81int __init mac_parse_bootinfo(const struct bi_record *record)
82{
Roman Zippel6ff58012007-05-01 22:32:43 +020083 int unknown = 0;
84 const u_long *data = record->data;
Linus Torvalds1da177e2005-04-16 15:20:36 -070085
Roman Zippel6ff58012007-05-01 22:32:43 +020086 switch (record->tag) {
Linus Torvalds1da177e2005-04-16 15:20:36 -070087 case BI_MAC_MODEL:
Roman Zippel6ff58012007-05-01 22:32:43 +020088 mac_bi_data.id = *data;
89 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -070090 case BI_MAC_VADDR:
Roman Zippel6ff58012007-05-01 22:32:43 +020091 mac_bi_data.videoaddr = *data;
92 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -070093 case BI_MAC_VDEPTH:
Roman Zippel6ff58012007-05-01 22:32:43 +020094 mac_bi_data.videodepth = *data;
95 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -070096 case BI_MAC_VROW:
Roman Zippel6ff58012007-05-01 22:32:43 +020097 mac_bi_data.videorow = *data;
98 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -070099 case BI_MAC_VDIM:
Roman Zippel6ff58012007-05-01 22:32:43 +0200100 mac_bi_data.dimensions = *data;
101 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700102 case BI_MAC_VLOGICAL:
Roman Zippel6ff58012007-05-01 22:32:43 +0200103 mac_bi_data.videological = VIDEOMEMBASE + (*data & ~VIDEOMEMMASK);
104 mac_orig_videoaddr = *data;
105 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106 case BI_MAC_SCCBASE:
Roman Zippel6ff58012007-05-01 22:32:43 +0200107 mac_bi_data.sccbase = *data;
108 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700109 case BI_MAC_BTIME:
Roman Zippel6ff58012007-05-01 22:32:43 +0200110 mac_bi_data.boottime = *data;
111 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700112 case BI_MAC_GMTBIAS:
Roman Zippel6ff58012007-05-01 22:32:43 +0200113 mac_bi_data.gmtbias = *data;
114 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700115 case BI_MAC_MEMSIZE:
Roman Zippel6ff58012007-05-01 22:32:43 +0200116 mac_bi_data.memsize = *data;
117 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700118 case BI_MAC_CPUID:
Roman Zippel6ff58012007-05-01 22:32:43 +0200119 mac_bi_data.cpuid = *data;
120 break;
121 case BI_MAC_ROMBASE:
122 mac_bi_data.rombase = *data;
123 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700124 default:
Roman Zippel6ff58012007-05-01 22:32:43 +0200125 unknown = 1;
126 break;
127 }
128 return unknown;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700129}
130
131/*
132 * Flip into 24bit mode for an instant - flushes the L2 cache card. We
133 * have to disable interrupts for this. Our IRQ handlers will crap
134 * themselves if they take an IRQ in 24bit mode!
135 */
136
137static void mac_cache_card_flush(int writeback)
138{
139 unsigned long flags;
Roman Zippel6ff58012007-05-01 22:32:43 +0200140
Linus Torvalds1da177e2005-04-16 15:20:36 -0700141 local_irq_save(flags);
142 via_flush_cache();
143 local_irq_restore(flags);
144}
145
146void __init config_mac(void)
147{
Roman Zippel6ff58012007-05-01 22:32:43 +0200148 if (!MACH_IS_MAC)
149 printk(KERN_ERR "ERROR: no Mac, but config_mac() called!! \n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700150
Roman Zippel6ff58012007-05-01 22:32:43 +0200151 mach_sched_init = mac_sched_init;
152 mach_init_IRQ = mac_init_IRQ;
153 mach_get_model = mac_get_model;
154 mach_gettimeoffset = mac_gettimeoffset;
Roman Zippel6ff58012007-05-01 22:32:43 +0200155 mach_hwclk = mac_hwclk;
Roman Zippel6ff58012007-05-01 22:32:43 +0200156 mach_set_clock_mmss = mac_set_clock_mmss;
157 mach_reset = mac_reset;
158 mach_halt = mac_poweroff;
159 mach_power_off = mac_poweroff;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700160 mach_max_dma_address = 0xffffffff;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700161#if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE)
Roman Zippel6ff58012007-05-01 22:32:43 +0200162 mach_beep = mac_mksound;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700163#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700164
165 /*
166 * Determine hardware present
167 */
168
169 mac_identify();
170 mac_report_hardware();
171
Roman Zippel6ff58012007-05-01 22:32:43 +0200172 /*
173 * AFAIK only the IIci takes a cache card. The IIfx has onboard
174 * cache ... someone needs to figure out how to tell if it's on or
175 * not.
176 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700177
178 if (macintosh_config->ident == MAC_MODEL_IICI
Roman Zippel6ff58012007-05-01 22:32:43 +0200179 || macintosh_config->ident == MAC_MODEL_IIFX)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700180 mach_l2_flush = mac_cache_card_flush;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700181}
182
183
184/*
Finn Thain53aac0a2009-11-04 00:39:09 +1100185 * Macintosh Table: hardcoded model configuration data.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700186 *
Finn Thain53aac0a2009-11-04 00:39:09 +1100187 * Much of this was defined by Alan, based on who knows what docs.
188 * I've added a lot more, and some of that was pure guesswork based
189 * on hardware pages present on the Mac web site. Possibly wildly
190 * inaccurate, so look here if a new Mac model won't run. Example: if
191 * a Mac crashes immediately after the VIA1 registers have been dumped
192 * to the screen, it probably died attempting to read DirB on a RBV.
193 * Meaning it should have MAC_VIA_IIci here :-)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700194 */
195
196struct mac_model *macintosh_config;
197EXPORT_SYMBOL(macintosh_config);
198
Roman Zippel6ff58012007-05-01 22:32:43 +0200199static struct mac_model mac_data_table[] = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700200 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100201 * We'll pretend to be a Macintosh II, that's pretty safe.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700202 */
203
204 {
205 .ident = MAC_MODEL_II,
206 .name = "Unknown",
207 .adb_type = MAC_ADB_II,
208 .via_type = MAC_VIA_II,
209 .scsi_type = MAC_SCSI_OLD,
210 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100211 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100212 .floppy_type = MAC_FLOPPY_IWM,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700213 },
214
215 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100216 * Original Mac II hardware
Linus Torvalds1da177e2005-04-16 15:20:36 -0700217 */
218
219 {
220 .ident = MAC_MODEL_II,
221 .name = "II",
222 .adb_type = MAC_ADB_II,
223 .via_type = MAC_VIA_II,
224 .scsi_type = MAC_SCSI_OLD,
225 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100226 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100227 .floppy_type = MAC_FLOPPY_IWM,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700228 }, {
229 .ident = MAC_MODEL_IIX,
230 .name = "IIx",
231 .adb_type = MAC_ADB_II,
232 .via_type = MAC_VIA_II,
233 .scsi_type = MAC_SCSI_OLD,
234 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100235 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100236 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700237 }, {
238 .ident = MAC_MODEL_IICX,
239 .name = "IIcx",
240 .adb_type = MAC_ADB_II,
241 .via_type = MAC_VIA_II,
242 .scsi_type = MAC_SCSI_OLD,
243 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100244 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100245 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700246 }, {
247 .ident = MAC_MODEL_SE30,
248 .name = "SE/30",
249 .adb_type = MAC_ADB_II,
250 .via_type = MAC_VIA_II,
251 .scsi_type = MAC_SCSI_OLD,
252 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100253 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100254 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700255 },
256
257 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100258 * Weirdified Mac II hardware - all subtly different. Gee thanks
259 * Apple. All these boxes seem to have VIA2 in a different place to
260 * the Mac II (+1A000 rather than +4000)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700261 * CSA: see http://developer.apple.com/technotes/hw/hw_09.html
262 */
263
264 {
265 .ident = MAC_MODEL_IICI,
266 .name = "IIci",
267 .adb_type = MAC_ADB_II,
268 .via_type = MAC_VIA_IIci,
269 .scsi_type = MAC_SCSI_OLD,
270 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100271 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100272 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700273 }, {
274 .ident = MAC_MODEL_IIFX,
275 .name = "IIfx",
276 .adb_type = MAC_ADB_IOP,
277 .via_type = MAC_VIA_IIci,
278 .scsi_type = MAC_SCSI_OLD,
279 .scc_type = MAC_SCC_IOP,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100280 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100281 .floppy_type = MAC_FLOPPY_SWIM_IOP,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700282 }, {
283 .ident = MAC_MODEL_IISI,
284 .name = "IIsi",
285 .adb_type = MAC_ADB_IISI,
286 .via_type = MAC_VIA_IIci,
287 .scsi_type = MAC_SCSI_OLD,
288 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100289 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100290 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700291 }, {
292 .ident = MAC_MODEL_IIVI,
293 .name = "IIvi",
294 .adb_type = MAC_ADB_IISI,
295 .via_type = MAC_VIA_IIci,
296 .scsi_type = MAC_SCSI_OLD,
297 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100298 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100299 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700300 }, {
301 .ident = MAC_MODEL_IIVX,
302 .name = "IIvx",
303 .adb_type = MAC_ADB_IISI,
304 .via_type = MAC_VIA_IIci,
305 .scsi_type = MAC_SCSI_OLD,
306 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100307 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100308 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700309 },
310
311 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100312 * Classic models (guessing: similar to SE/30? Nope, similar to LC...)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700313 */
314
315 {
316 .ident = MAC_MODEL_CLII,
317 .name = "Classic II",
318 .adb_type = MAC_ADB_IISI,
319 .via_type = MAC_VIA_IIci,
320 .scsi_type = MAC_SCSI_OLD,
321 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100322 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100323 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700324 }, {
325 .ident = MAC_MODEL_CCL,
326 .name = "Color Classic",
327 .adb_type = MAC_ADB_CUDA,
328 .via_type = MAC_VIA_IIci,
329 .scsi_type = MAC_SCSI_OLD,
330 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100331 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100332 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100333 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700334
335 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100336 * Some Mac LC machines. Basically the same as the IIci, ADB like IIsi
Linus Torvalds1da177e2005-04-16 15:20:36 -0700337 */
338
339 {
340 .ident = MAC_MODEL_LC,
341 .name = "LC",
342 .adb_type = MAC_ADB_IISI,
343 .via_type = MAC_VIA_IIci,
344 .scsi_type = MAC_SCSI_OLD,
345 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100346 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100347 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700348 }, {
349 .ident = MAC_MODEL_LCII,
350 .name = "LC II",
351 .adb_type = MAC_ADB_IISI,
352 .via_type = MAC_VIA_IIci,
353 .scsi_type = MAC_SCSI_OLD,
354 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100355 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100356 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700357 }, {
358 .ident = MAC_MODEL_LCIII,
359 .name = "LC III",
360 .adb_type = MAC_ADB_IISI,
361 .via_type = MAC_VIA_IIci,
362 .scsi_type = MAC_SCSI_OLD,
363 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100364 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100365 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700366 },
367
368 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100369 * Quadra. Video is at 0xF9000000, via is like a MacII. We label it
370 * differently as some of the stuff connected to VIA2 seems different.
371 * Better SCSI chip and onboard ethernet using a NatSemi SONIC except
372 * the 660AV and 840AV which use an AMD 79C940 (MACE).
373 * The 700, 900 and 950 have some I/O chips in the wrong place to
374 * confuse us. The 840AV has a SCSI location of its own (same as
375 * the 660AV).
Linus Torvalds1da177e2005-04-16 15:20:36 -0700376 */
377
378 {
379 .ident = MAC_MODEL_Q605,
380 .name = "Quadra 605",
381 .adb_type = MAC_ADB_CUDA,
382 .via_type = MAC_VIA_QUADRA,
383 .scsi_type = MAC_SCSI_QUADRA,
384 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100385 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100386 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700387 }, {
388 .ident = MAC_MODEL_Q605_ACC,
389 .name = "Quadra 605",
390 .adb_type = MAC_ADB_CUDA,
391 .via_type = MAC_VIA_QUADRA,
392 .scsi_type = MAC_SCSI_QUADRA,
393 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100394 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100395 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700396 }, {
397 .ident = MAC_MODEL_Q610,
398 .name = "Quadra 610",
399 .adb_type = MAC_ADB_II,
400 .via_type = MAC_VIA_QUADRA,
401 .scsi_type = MAC_SCSI_QUADRA,
402 .scc_type = MAC_SCC_QUADRA,
403 .ether_type = MAC_ETHER_SONIC,
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_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700406 }, {
407 .ident = MAC_MODEL_Q630,
408 .name = "Quadra 630",
409 .adb_type = MAC_ADB_CUDA,
410 .via_type = MAC_VIA_QUADRA,
411 .scsi_type = MAC_SCSI_QUADRA,
412 .ide_type = MAC_IDE_QUADRA,
413 .scc_type = MAC_SCC_QUADRA,
414 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100415 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100416 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700417 }, {
418 .ident = MAC_MODEL_Q650,
419 .name = "Quadra 650",
420 .adb_type = MAC_ADB_II,
421 .via_type = MAC_VIA_QUADRA,
422 .scsi_type = MAC_SCSI_QUADRA,
423 .scc_type = MAC_SCC_QUADRA,
424 .ether_type = MAC_ETHER_SONIC,
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 },
Finn Thain53aac0a2009-11-04 00:39:09 +1100428 /* The Q700 does have a NS Sonic */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700429 {
430 .ident = MAC_MODEL_Q700,
431 .name = "Quadra 700",
432 .adb_type = MAC_ADB_II,
433 .via_type = MAC_VIA_QUADRA,
434 .scsi_type = MAC_SCSI_QUADRA2,
435 .scc_type = MAC_SCC_QUADRA,
436 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100437 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100438 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700439 }, {
440 .ident = MAC_MODEL_Q800,
441 .name = "Quadra 800",
442 .adb_type = MAC_ADB_II,
443 .via_type = MAC_VIA_QUADRA,
444 .scsi_type = MAC_SCSI_QUADRA,
445 .scc_type = MAC_SCC_QUADRA,
446 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100447 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100448 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700449 }, {
450 .ident = MAC_MODEL_Q840,
451 .name = "Quadra 840AV",
452 .adb_type = MAC_ADB_CUDA,
453 .via_type = MAC_VIA_QUADRA,
454 .scsi_type = MAC_SCSI_QUADRA3,
455 .scc_type = MAC_SCC_PSC,
456 .ether_type = MAC_ETHER_MACE,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100457 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100458 .floppy_type = MAC_FLOPPY_AV,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700459 }, {
460 .ident = MAC_MODEL_Q900,
461 .name = "Quadra 900",
462 .adb_type = MAC_ADB_IOP,
463 .via_type = MAC_VIA_QUADRA,
464 .scsi_type = MAC_SCSI_QUADRA2,
465 .scc_type = MAC_SCC_IOP,
466 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100467 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100468 .floppy_type = MAC_FLOPPY_SWIM_IOP,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700469 }, {
470 .ident = MAC_MODEL_Q950,
471 .name = "Quadra 950",
472 .adb_type = MAC_ADB_IOP,
473 .via_type = MAC_VIA_QUADRA,
474 .scsi_type = MAC_SCSI_QUADRA2,
475 .scc_type = MAC_SCC_IOP,
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_IOP,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700479 },
480
481 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100482 * Performa - more LC type machines
Linus Torvalds1da177e2005-04-16 15:20:36 -0700483 */
484
485 {
486 .ident = MAC_MODEL_P460,
Finn Thain53aac0a2009-11-04 00:39:09 +1100487 .name = "Performa 460",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700488 .adb_type = MAC_ADB_IISI,
489 .via_type = MAC_VIA_IIci,
490 .scsi_type = MAC_SCSI_OLD,
491 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100492 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100493 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700494 }, {
495 .ident = MAC_MODEL_P475,
Finn Thain53aac0a2009-11-04 00:39:09 +1100496 .name = "Performa 475",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700497 .adb_type = MAC_ADB_CUDA,
498 .via_type = MAC_VIA_QUADRA,
499 .scsi_type = MAC_SCSI_QUADRA,
500 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100501 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100502 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700503 }, {
504 .ident = MAC_MODEL_P475F,
Finn Thain53aac0a2009-11-04 00:39:09 +1100505 .name = "Performa 475",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700506 .adb_type = MAC_ADB_CUDA,
507 .via_type = MAC_VIA_QUADRA,
508 .scsi_type = MAC_SCSI_QUADRA,
509 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100510 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100511 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700512 }, {
513 .ident = MAC_MODEL_P520,
Finn Thain53aac0a2009-11-04 00:39:09 +1100514 .name = "Performa 520",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700515 .adb_type = MAC_ADB_CUDA,
516 .via_type = MAC_VIA_IIci,
517 .scsi_type = MAC_SCSI_OLD,
518 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100519 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100520 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700521 }, {
522 .ident = MAC_MODEL_P550,
Finn Thain53aac0a2009-11-04 00:39:09 +1100523 .name = "Performa 550",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700524 .adb_type = MAC_ADB_CUDA,
525 .via_type = MAC_VIA_IIci,
526 .scsi_type = MAC_SCSI_OLD,
527 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100528 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100529 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700530 },
Finn Thain53aac0a2009-11-04 00:39:09 +1100531 /* These have the comm slot, and therefore possibly SONIC ethernet */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700532 {
533 .ident = MAC_MODEL_P575,
534 .name = "Performa 575",
535 .adb_type = MAC_ADB_CUDA,
536 .via_type = MAC_VIA_QUADRA,
537 .scsi_type = MAC_SCSI_QUADRA,
538 .scc_type = MAC_SCC_II,
539 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100540 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100541 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700542 }, {
543 .ident = MAC_MODEL_P588,
544 .name = "Performa 588",
545 .adb_type = MAC_ADB_CUDA,
546 .via_type = MAC_VIA_QUADRA,
547 .scsi_type = MAC_SCSI_QUADRA,
548 .ide_type = MAC_IDE_QUADRA,
549 .scc_type = MAC_SCC_II,
550 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100551 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100552 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700553 }, {
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,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100560 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100561 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700562 }, {
563 .ident = MAC_MODEL_P600,
564 .name = "Performa 600",
565 .adb_type = MAC_ADB_IISI,
566 .via_type = MAC_VIA_IIci,
567 .scsi_type = MAC_SCSI_OLD,
568 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100569 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100570 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700571 },
572
573 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100574 * Centris - just guessing again; maybe like Quadra.
575 * The C610 may or may not have SONIC. We probe to make sure.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700576 */
577
Linus Torvalds1da177e2005-04-16 15:20:36 -0700578 {
579 .ident = MAC_MODEL_C610,
580 .name = "Centris 610",
581 .adb_type = MAC_ADB_II,
582 .via_type = MAC_VIA_QUADRA,
583 .scsi_type = MAC_SCSI_QUADRA,
584 .scc_type = MAC_SCC_QUADRA,
585 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100586 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100587 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700588 }, {
589 .ident = MAC_MODEL_C650,
590 .name = "Centris 650",
591 .adb_type = MAC_ADB_II,
592 .via_type = MAC_VIA_QUADRA,
593 .scsi_type = MAC_SCSI_QUADRA,
594 .scc_type = MAC_SCC_QUADRA,
595 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100596 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100597 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700598 }, {
599 .ident = MAC_MODEL_C660,
600 .name = "Centris 660AV",
601 .adb_type = MAC_ADB_CUDA,
602 .via_type = MAC_VIA_QUADRA,
603 .scsi_type = MAC_SCSI_QUADRA3,
604 .scc_type = MAC_SCC_PSC,
605 .ether_type = MAC_ETHER_MACE,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100606 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100607 .floppy_type = MAC_FLOPPY_AV,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700608 },
609
610 /*
611 * The PowerBooks all the same "Combo" custom IC for SCSI and SCC
612 * and a PMU (in two variations?) for ADB. Most of them use the
613 * Quadra-style VIAs. A few models also have IDE from hell.
614 */
615
616 {
617 .ident = MAC_MODEL_PB140,
618 .name = "PowerBook 140",
619 .adb_type = MAC_ADB_PB1,
620 .via_type = MAC_VIA_QUADRA,
621 .scsi_type = MAC_SCSI_OLD,
622 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100623 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100624 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700625 }, {
626 .ident = MAC_MODEL_PB145,
627 .name = "PowerBook 145",
628 .adb_type = MAC_ADB_PB1,
629 .via_type = MAC_VIA_QUADRA,
630 .scsi_type = MAC_SCSI_OLD,
631 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100632 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100633 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700634 }, {
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,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100642 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100643 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700644 }, {
645 .ident = MAC_MODEL_PB160,
646 .name = "PowerBook 160",
647 .adb_type = MAC_ADB_PB1,
648 .via_type = MAC_VIA_QUADRA,
649 .scsi_type = MAC_SCSI_OLD,
650 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100651 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100652 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700653 }, {
654 .ident = MAC_MODEL_PB165,
655 .name = "PowerBook 165",
656 .adb_type = MAC_ADB_PB1,
657 .via_type = MAC_VIA_QUADRA,
658 .scsi_type = MAC_SCSI_OLD,
659 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100660 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100661 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700662 }, {
663 .ident = MAC_MODEL_PB165C,
664 .name = "PowerBook 165c",
665 .adb_type = MAC_ADB_PB1,
666 .via_type = MAC_VIA_QUADRA,
667 .scsi_type = MAC_SCSI_OLD,
668 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100669 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100670 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700671 }, {
672 .ident = MAC_MODEL_PB170,
673 .name = "PowerBook 170",
674 .adb_type = MAC_ADB_PB1,
675 .via_type = MAC_VIA_QUADRA,
676 .scsi_type = MAC_SCSI_OLD,
677 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100678 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100679 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700680 }, {
681 .ident = MAC_MODEL_PB180,
682 .name = "PowerBook 180",
683 .adb_type = MAC_ADB_PB1,
684 .via_type = MAC_VIA_QUADRA,
685 .scsi_type = MAC_SCSI_OLD,
686 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100687 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100688 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700689 }, {
690 .ident = MAC_MODEL_PB180C,
691 .name = "PowerBook 180c",
692 .adb_type = MAC_ADB_PB1,
693 .via_type = MAC_VIA_QUADRA,
694 .scsi_type = MAC_SCSI_OLD,
695 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100696 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100697 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700698 }, {
699 .ident = MAC_MODEL_PB190,
700 .name = "PowerBook 190",
701 .adb_type = MAC_ADB_PB2,
702 .via_type = MAC_VIA_QUADRA,
703 .scsi_type = MAC_SCSI_OLD,
704 .ide_type = MAC_IDE_BABOON,
705 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100706 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100707 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700708 }, {
709 .ident = MAC_MODEL_PB520,
710 .name = "PowerBook 520",
711 .adb_type = MAC_ADB_PB2,
712 .via_type = MAC_VIA_QUADRA,
713 .scsi_type = MAC_SCSI_OLD,
714 .scc_type = MAC_SCC_QUADRA,
715 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100716 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100717 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700718 },
719
720 /*
721 * PowerBook Duos are pretty much like normal PowerBooks
722 * All of these probably have onboard SONIC in the Dock which
723 * means we'll have to probe for it eventually.
724 *
Simon Arlott0c79cf62007-10-20 01:20:32 +0200725 * Are these really MAC_VIA_IIci? The developer notes for the
Linus Torvalds1da177e2005-04-16 15:20:36 -0700726 * Duos show pretty much the same custom parts as in most of
727 * the other PowerBooks which would imply MAC_VIA_QUADRA.
728 */
729
730 {
731 .ident = MAC_MODEL_PB210,
732 .name = "PowerBook Duo 210",
733 .adb_type = MAC_ADB_PB2,
734 .via_type = MAC_VIA_IIci,
735 .scsi_type = MAC_SCSI_OLD,
736 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100737 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100738 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700739 }, {
740 .ident = MAC_MODEL_PB230,
741 .name = "PowerBook Duo 230",
742 .adb_type = MAC_ADB_PB2,
743 .via_type = MAC_VIA_IIci,
744 .scsi_type = MAC_SCSI_OLD,
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_PB250,
750 .name = "PowerBook Duo 250",
751 .adb_type = MAC_ADB_PB2,
752 .via_type = MAC_VIA_IIci,
753 .scsi_type = MAC_SCSI_OLD,
754 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100755 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100756 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700757 }, {
758 .ident = MAC_MODEL_PB270C,
759 .name = "PowerBook Duo 270c",
760 .adb_type = MAC_ADB_PB2,
761 .via_type = MAC_VIA_IIci,
762 .scsi_type = MAC_SCSI_OLD,
763 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100764 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100765 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700766 }, {
767 .ident = MAC_MODEL_PB280,
768 .name = "PowerBook Duo 280",
769 .adb_type = MAC_ADB_PB2,
770 .via_type = MAC_VIA_IIci,
771 .scsi_type = MAC_SCSI_OLD,
772 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100773 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100774 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700775 }, {
776 .ident = MAC_MODEL_PB280C,
777 .name = "PowerBook Duo 280c",
778 .adb_type = MAC_ADB_PB2,
779 .via_type = MAC_VIA_IIci,
780 .scsi_type = MAC_SCSI_OLD,
781 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100782 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100783 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700784 },
785
786 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100787 * Other stuff?
Linus Torvalds1da177e2005-04-16 15:20:36 -0700788 */
Finn Thain53aac0a2009-11-04 00:39:09 +1100789
Linus Torvalds1da177e2005-04-16 15:20:36 -0700790 {
791 .ident = -1
792 }
793};
794
Finn Thain80614e52009-11-17 20:06:48 +1100795static struct resource scc_a_rsrcs[] = {
796 { .flags = IORESOURCE_MEM },
797 { .flags = IORESOURCE_IRQ },
798};
799
800static struct resource scc_b_rsrcs[] = {
801 { .flags = IORESOURCE_MEM },
802 { .flags = IORESOURCE_IRQ },
803};
804
805struct platform_device scc_a_pdev = {
806 .name = "scc",
807 .id = 0,
808 .num_resources = ARRAY_SIZE(scc_a_rsrcs),
809 .resource = scc_a_rsrcs,
810};
811EXPORT_SYMBOL(scc_a_pdev);
812
813struct platform_device scc_b_pdev = {
814 .name = "scc",
815 .id = 1,
816 .num_resources = ARRAY_SIZE(scc_b_rsrcs),
817 .resource = scc_b_rsrcs,
818};
819EXPORT_SYMBOL(scc_b_pdev);
820
Adrian Bunk8dfbdf42008-07-17 21:16:25 +0200821static void __init mac_identify(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700822{
823 struct mac_model *m;
824
825 /* Penguin data useful? */
826 int model = mac_bi_data.id;
827 if (!model) {
828 /* no bootinfo model id -> NetBSD booter was used! */
829 /* XXX FIXME: breaks for model > 31 */
Roman Zippel6ff58012007-05-01 22:32:43 +0200830 model = (mac_bi_data.cpuid >> 2) & 63;
Finn Thain53aac0a2009-11-04 00:39:09 +1100831 printk(KERN_WARNING "No bootinfo model ID, using cpuid instead "
832 "(obsolete bootloader?)\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700833 }
834
835 macintosh_config = mac_data_table;
Roman Zippel6ff58012007-05-01 22:32:43 +0200836 for (m = macintosh_config; m->ident != -1; m++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700837 if (m->ident == model) {
838 macintosh_config = m;
839 break;
840 }
841 }
842
Finn Thain80614e52009-11-17 20:06:48 +1100843 /* Set up serial port resources for the console initcall. */
844
845 scc_a_rsrcs[0].start = (resource_size_t) mac_bi_data.sccbase + 2;
846 scc_a_rsrcs[0].end = scc_a_rsrcs[0].start;
847 scc_b_rsrcs[0].start = (resource_size_t) mac_bi_data.sccbase;
848 scc_b_rsrcs[0].end = scc_b_rsrcs[0].start;
849
850 switch (macintosh_config->scc_type) {
851 case MAC_SCC_PSC:
852 scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC_A;
853 scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC_B;
854 break;
855 default:
856 scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC;
857 scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC;
858 break;
859 }
860
Finn Thain53aac0a2009-11-04 00:39:09 +1100861 /*
862 * We need to pre-init the IOPs, if any. Otherwise
863 * the serial console won't work if the user had
864 * the serial ports set to "Faster" mode in MacOS.
865 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700866 iop_preinit();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700867
Roman Zippel6ff58012007-05-01 22:32:43 +0200868 printk(KERN_INFO "Detected Macintosh model: %d \n", model);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700869
870 /*
871 * Report booter data:
872 */
Roman Zippel6ff58012007-05-01 22:32:43 +0200873 printk(KERN_DEBUG " Penguin bootinfo data:\n");
Finn Thain53aac0a2009-11-04 00:39:09 +1100874 printk(KERN_DEBUG " Video: addr 0x%lx "
875 "row 0x%lx depth %lx dimensions %ld x %ld\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700876 mac_bi_data.videoaddr, mac_bi_data.videorow,
877 mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF,
878 mac_bi_data.dimensions >> 16);
Roman Zippel6ff58012007-05-01 22:32:43 +0200879 printk(KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx \n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700880 mac_bi_data.videological, mac_orig_videoaddr,
881 mac_bi_data.sccbase);
Roman Zippel6ff58012007-05-01 22:32:43 +0200882 printk(KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx \n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700883 mac_bi_data.boottime, mac_bi_data.gmtbias);
Roman Zippel6ff58012007-05-01 22:32:43 +0200884 printk(KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx \n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700885 mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700886
Linus Torvalds1da177e2005-04-16 15:20:36 -0700887 iop_init();
888 via_init();
889 oss_init();
890 psc_init();
891 baboon_init();
892}
893
Adrian Bunk8dfbdf42008-07-17 21:16:25 +0200894static void __init mac_report_hardware(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700895{
896 printk(KERN_INFO "Apple Macintosh %s\n", macintosh_config->name);
897}
898
899static void mac_get_model(char *str)
900{
Roman Zippel6ff58012007-05-01 22:32:43 +0200901 strcpy(str, "Macintosh ");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700902 strcat(str, macintosh_config->name);
903}
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100904
Finn Thain2724daf2009-11-04 00:39:56 +1100905static struct resource swim_rsrc = { .flags = IORESOURCE_MEM };
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100906
Finn Thain2724daf2009-11-04 00:39:56 +1100907static struct platform_device swim_pdev = {
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100908 .name = "swim",
909 .id = -1,
Finn Thain2724daf2009-11-04 00:39:56 +1100910 .num_resources = 1,
911 .resource = &swim_rsrc,
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100912};
913
Finn Thaincff75f12009-11-04 00:41:35 +1100914static struct platform_device esp_0_pdev = {
915 .name = "mac_esp",
916 .id = 0,
917};
918
919static struct platform_device esp_1_pdev = {
920 .name = "mac_esp",
921 .id = 1,
922};
923
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100924int __init mac_platform_init(void)
925{
926 u8 *swim_base;
927
Finn Thain2724daf2009-11-04 00:39:56 +1100928 /*
Finn Thain80614e52009-11-17 20:06:48 +1100929 * Serial devices
930 */
931
932 platform_device_register(&scc_a_pdev);
933 platform_device_register(&scc_b_pdev);
934
935 /*
Finn Thain2724daf2009-11-04 00:39:56 +1100936 * Floppy device
937 */
938
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100939 switch (macintosh_config->floppy_type) {
940 case MAC_FLOPPY_SWIM_ADDR1:
941 swim_base = (u8 *)(VIA1_BASE + 0x1E000);
942 break;
943 case MAC_FLOPPY_SWIM_ADDR2:
944 swim_base = (u8 *)(VIA1_BASE + 0x16000);
945 break;
946 default:
Finn Thain2724daf2009-11-04 00:39:56 +1100947 swim_base = NULL;
948 break;
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100949 }
950
Finn Thain2724daf2009-11-04 00:39:56 +1100951 if (swim_base) {
952 swim_rsrc.start = (resource_size_t) swim_base,
953 swim_rsrc.end = (resource_size_t) swim_base + 0x2000,
954 platform_device_register(&swim_pdev);
955 }
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100956
Finn Thaincff75f12009-11-04 00:41:35 +1100957 /*
958 * SCSI device(s)
959 */
960
961 switch (macintosh_config->scsi_type) {
962 case MAC_SCSI_QUADRA:
963 case MAC_SCSI_QUADRA3:
964 platform_device_register(&esp_0_pdev);
965 break;
966 case MAC_SCSI_QUADRA2:
967 platform_device_register(&esp_0_pdev);
968 if ((macintosh_config->ident == MAC_MODEL_Q900) ||
969 (macintosh_config->ident == MAC_MODEL_Q950))
970 platform_device_register(&esp_1_pdev);
971 break;
972 }
973
Finn Thain2724daf2009-11-04 00:39:56 +1100974 return 0;
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100975}
976
977arch_initcall(mac_platform_init);