blob: cad55bc087dfb1e7a367bf5798969c2807dd4088 [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
Laurent Vivier8852ecd2008-11-15 16:10:10 +010047/* platform device info */
48
49#define SWIM_IO_SIZE 0x2000 /* SWIM IO resource size */
50
Linus Torvalds1da177e2005-04-16 15:20:36 -070051/* Mac bootinfo struct */
Linus Torvalds1da177e2005-04-16 15:20:36 -070052struct mac_booter_data mac_bi_data;
Linus Torvalds1da177e2005-04-16 15:20:36 -070053
Linus Torvalds1da177e2005-04-16 15:20:36 -070054/* The phys. video addr. - might be bogus on some machines */
Adrian Bunk8dfbdf42008-07-17 21:16:25 +020055static unsigned long mac_orig_videoaddr;
Linus Torvalds1da177e2005-04-16 15:20:36 -070056
57/* Mac specific timer functions */
Roman Zippel6ff58012007-05-01 22:32:43 +020058extern unsigned long mac_gettimeoffset(void);
59extern int mac_hwclk(int, struct rtc_time *);
60extern int mac_set_clock_mmss(unsigned long);
Linus Torvalds1da177e2005-04-16 15:20:36 -070061extern void iop_preinit(void);
62extern void iop_init(void);
63extern void via_init(void);
David Howells40220c12006-10-09 12:19:47 +010064extern void via_init_clock(irq_handler_t func);
Linus Torvalds1da177e2005-04-16 15:20:36 -070065extern void via_flush_cache(void);
66extern void oss_init(void);
67extern void psc_init(void);
68extern void baboon_init(void);
69
70extern void mac_mksound(unsigned int, unsigned int);
71
Linus Torvalds1da177e2005-04-16 15:20:36 -070072static void mac_get_model(char *str);
Adrian Bunk8dfbdf42008-07-17 21:16:25 +020073static void mac_identify(void);
74static void mac_report_hardware(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070075
Al Viro66a3f822007-07-20 04:33:28 +010076static void __init mac_sched_init(irq_handler_t vector)
Linus Torvalds1da177e2005-04-16 15:20:36 -070077{
78 via_init_clock(vector);
79}
80
Linus Torvalds1da177e2005-04-16 15:20:36 -070081/*
82 * Parse a Macintosh-specific record in the bootinfo
83 */
84
85int __init mac_parse_bootinfo(const struct bi_record *record)
86{
Roman Zippel6ff58012007-05-01 22:32:43 +020087 int unknown = 0;
88 const u_long *data = record->data;
Linus Torvalds1da177e2005-04-16 15:20:36 -070089
Roman Zippel6ff58012007-05-01 22:32:43 +020090 switch (record->tag) {
Linus Torvalds1da177e2005-04-16 15:20:36 -070091 case BI_MAC_MODEL:
Roman Zippel6ff58012007-05-01 22:32:43 +020092 mac_bi_data.id = *data;
93 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -070094 case BI_MAC_VADDR:
Roman Zippel6ff58012007-05-01 22:32:43 +020095 mac_bi_data.videoaddr = *data;
96 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -070097 case BI_MAC_VDEPTH:
Roman Zippel6ff58012007-05-01 22:32:43 +020098 mac_bi_data.videodepth = *data;
99 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700100 case BI_MAC_VROW:
Roman Zippel6ff58012007-05-01 22:32:43 +0200101 mac_bi_data.videorow = *data;
102 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700103 case BI_MAC_VDIM:
Roman Zippel6ff58012007-05-01 22:32:43 +0200104 mac_bi_data.dimensions = *data;
105 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106 case BI_MAC_VLOGICAL:
Roman Zippel6ff58012007-05-01 22:32:43 +0200107 mac_bi_data.videological = VIDEOMEMBASE + (*data & ~VIDEOMEMMASK);
108 mac_orig_videoaddr = *data;
109 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700110 case BI_MAC_SCCBASE:
Roman Zippel6ff58012007-05-01 22:32:43 +0200111 mac_bi_data.sccbase = *data;
112 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700113 case BI_MAC_BTIME:
Roman Zippel6ff58012007-05-01 22:32:43 +0200114 mac_bi_data.boottime = *data;
115 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700116 case BI_MAC_GMTBIAS:
Roman Zippel6ff58012007-05-01 22:32:43 +0200117 mac_bi_data.gmtbias = *data;
118 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700119 case BI_MAC_MEMSIZE:
Roman Zippel6ff58012007-05-01 22:32:43 +0200120 mac_bi_data.memsize = *data;
121 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700122 case BI_MAC_CPUID:
Roman Zippel6ff58012007-05-01 22:32:43 +0200123 mac_bi_data.cpuid = *data;
124 break;
125 case BI_MAC_ROMBASE:
126 mac_bi_data.rombase = *data;
127 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700128 default:
Roman Zippel6ff58012007-05-01 22:32:43 +0200129 unknown = 1;
130 break;
131 }
132 return unknown;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700133}
134
135/*
136 * Flip into 24bit mode for an instant - flushes the L2 cache card. We
137 * have to disable interrupts for this. Our IRQ handlers will crap
138 * themselves if they take an IRQ in 24bit mode!
139 */
140
141static void mac_cache_card_flush(int writeback)
142{
143 unsigned long flags;
Roman Zippel6ff58012007-05-01 22:32:43 +0200144
Linus Torvalds1da177e2005-04-16 15:20:36 -0700145 local_irq_save(flags);
146 via_flush_cache();
147 local_irq_restore(flags);
148}
149
150void __init config_mac(void)
151{
Roman Zippel6ff58012007-05-01 22:32:43 +0200152 if (!MACH_IS_MAC)
153 printk(KERN_ERR "ERROR: no Mac, but config_mac() called!! \n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700154
Roman Zippel6ff58012007-05-01 22:32:43 +0200155 mach_sched_init = mac_sched_init;
156 mach_init_IRQ = mac_init_IRQ;
157 mach_get_model = mac_get_model;
158 mach_gettimeoffset = mac_gettimeoffset;
Roman Zippel6ff58012007-05-01 22:32:43 +0200159 mach_hwclk = mac_hwclk;
Roman Zippel6ff58012007-05-01 22:32:43 +0200160 mach_set_clock_mmss = mac_set_clock_mmss;
161 mach_reset = mac_reset;
162 mach_halt = mac_poweroff;
163 mach_power_off = mac_poweroff;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700164 mach_max_dma_address = 0xffffffff;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700165#if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE)
Roman Zippel6ff58012007-05-01 22:32:43 +0200166 mach_beep = mac_mksound;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700167#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700168
169 /*
170 * Determine hardware present
171 */
172
173 mac_identify();
174 mac_report_hardware();
175
Roman Zippel6ff58012007-05-01 22:32:43 +0200176 /*
177 * AFAIK only the IIci takes a cache card. The IIfx has onboard
178 * cache ... someone needs to figure out how to tell if it's on or
179 * not.
180 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700181
182 if (macintosh_config->ident == MAC_MODEL_IICI
Roman Zippel6ff58012007-05-01 22:32:43 +0200183 || macintosh_config->ident == MAC_MODEL_IIFX)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700184 mach_l2_flush = mac_cache_card_flush;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700185}
186
187
188/*
Finn Thain53aac0a2009-11-04 00:39:09 +1100189 * Macintosh Table: hardcoded model configuration data.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700190 *
Finn Thain53aac0a2009-11-04 00:39:09 +1100191 * Much of this was defined by Alan, based on who knows what docs.
192 * I've added a lot more, and some of that was pure guesswork based
193 * on hardware pages present on the Mac web site. Possibly wildly
194 * inaccurate, so look here if a new Mac model won't run. Example: if
195 * a Mac crashes immediately after the VIA1 registers have been dumped
196 * to the screen, it probably died attempting to read DirB on a RBV.
197 * Meaning it should have MAC_VIA_IIci here :-)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700198 */
199
200struct mac_model *macintosh_config;
201EXPORT_SYMBOL(macintosh_config);
202
Roman Zippel6ff58012007-05-01 22:32:43 +0200203static struct mac_model mac_data_table[] = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700204 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100205 * We'll pretend to be a Macintosh II, that's pretty safe.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700206 */
207
208 {
209 .ident = MAC_MODEL_II,
210 .name = "Unknown",
211 .adb_type = MAC_ADB_II,
212 .via_type = MAC_VIA_II,
213 .scsi_type = MAC_SCSI_OLD,
214 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100215 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100216 .floppy_type = MAC_FLOPPY_IWM,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700217 },
218
219 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100220 * Original Mac II hardware
Linus Torvalds1da177e2005-04-16 15:20:36 -0700221 */
222
223 {
224 .ident = MAC_MODEL_II,
225 .name = "II",
226 .adb_type = MAC_ADB_II,
227 .via_type = MAC_VIA_II,
228 .scsi_type = MAC_SCSI_OLD,
229 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100230 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100231 .floppy_type = MAC_FLOPPY_IWM,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700232 }, {
233 .ident = MAC_MODEL_IIX,
234 .name = "IIx",
235 .adb_type = MAC_ADB_II,
236 .via_type = MAC_VIA_II,
237 .scsi_type = MAC_SCSI_OLD,
238 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100239 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100240 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700241 }, {
242 .ident = MAC_MODEL_IICX,
243 .name = "IIcx",
244 .adb_type = MAC_ADB_II,
245 .via_type = MAC_VIA_II,
246 .scsi_type = MAC_SCSI_OLD,
247 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100248 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100249 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700250 }, {
251 .ident = MAC_MODEL_SE30,
252 .name = "SE/30",
253 .adb_type = MAC_ADB_II,
254 .via_type = MAC_VIA_II,
255 .scsi_type = MAC_SCSI_OLD,
256 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100257 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100258 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700259 },
260
261 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100262 * Weirdified Mac II hardware - all subtly different. Gee thanks
263 * Apple. All these boxes seem to have VIA2 in a different place to
264 * the Mac II (+1A000 rather than +4000)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700265 * CSA: see http://developer.apple.com/technotes/hw/hw_09.html
266 */
267
268 {
269 .ident = MAC_MODEL_IICI,
270 .name = "IIci",
271 .adb_type = MAC_ADB_II,
272 .via_type = MAC_VIA_IIci,
273 .scsi_type = MAC_SCSI_OLD,
274 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100275 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100276 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700277 }, {
278 .ident = MAC_MODEL_IIFX,
279 .name = "IIfx",
280 .adb_type = MAC_ADB_IOP,
281 .via_type = MAC_VIA_IIci,
282 .scsi_type = MAC_SCSI_OLD,
283 .scc_type = MAC_SCC_IOP,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100284 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100285 .floppy_type = MAC_FLOPPY_SWIM_IOP,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700286 }, {
287 .ident = MAC_MODEL_IISI,
288 .name = "IIsi",
289 .adb_type = MAC_ADB_IISI,
290 .via_type = MAC_VIA_IIci,
291 .scsi_type = MAC_SCSI_OLD,
292 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100293 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100294 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700295 }, {
296 .ident = MAC_MODEL_IIVI,
297 .name = "IIvi",
298 .adb_type = MAC_ADB_IISI,
299 .via_type = MAC_VIA_IIci,
300 .scsi_type = MAC_SCSI_OLD,
301 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100302 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100303 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700304 }, {
305 .ident = MAC_MODEL_IIVX,
306 .name = "IIvx",
307 .adb_type = MAC_ADB_IISI,
308 .via_type = MAC_VIA_IIci,
309 .scsi_type = MAC_SCSI_OLD,
310 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100311 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100312 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700313 },
314
315 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100316 * Classic models (guessing: similar to SE/30? Nope, similar to LC...)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700317 */
318
319 {
320 .ident = MAC_MODEL_CLII,
321 .name = "Classic II",
322 .adb_type = MAC_ADB_IISI,
323 .via_type = MAC_VIA_IIci,
324 .scsi_type = MAC_SCSI_OLD,
325 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100326 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100327 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700328 }, {
329 .ident = MAC_MODEL_CCL,
330 .name = "Color Classic",
331 .adb_type = MAC_ADB_CUDA,
332 .via_type = MAC_VIA_IIci,
333 .scsi_type = MAC_SCSI_OLD,
334 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100335 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100336 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100337 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700338
339 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100340 * Some Mac LC machines. Basically the same as the IIci, ADB like IIsi
Linus Torvalds1da177e2005-04-16 15:20:36 -0700341 */
342
343 {
344 .ident = MAC_MODEL_LC,
345 .name = "LC",
346 .adb_type = MAC_ADB_IISI,
347 .via_type = MAC_VIA_IIci,
348 .scsi_type = MAC_SCSI_OLD,
349 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100350 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100351 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700352 }, {
353 .ident = MAC_MODEL_LCII,
354 .name = "LC II",
355 .adb_type = MAC_ADB_IISI,
356 .via_type = MAC_VIA_IIci,
357 .scsi_type = MAC_SCSI_OLD,
358 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100359 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100360 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700361 }, {
362 .ident = MAC_MODEL_LCIII,
363 .name = "LC III",
364 .adb_type = MAC_ADB_IISI,
365 .via_type = MAC_VIA_IIci,
366 .scsi_type = MAC_SCSI_OLD,
367 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100368 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100369 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700370 },
371
372 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100373 * Quadra. Video is at 0xF9000000, via is like a MacII. We label it
374 * differently as some of the stuff connected to VIA2 seems different.
375 * Better SCSI chip and onboard ethernet using a NatSemi SONIC except
376 * the 660AV and 840AV which use an AMD 79C940 (MACE).
377 * The 700, 900 and 950 have some I/O chips in the wrong place to
378 * confuse us. The 840AV has a SCSI location of its own (same as
379 * the 660AV).
Linus Torvalds1da177e2005-04-16 15:20:36 -0700380 */
381
382 {
383 .ident = MAC_MODEL_Q605,
384 .name = "Quadra 605",
385 .adb_type = MAC_ADB_CUDA,
386 .via_type = MAC_VIA_QUADRA,
387 .scsi_type = MAC_SCSI_QUADRA,
388 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100389 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100390 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700391 }, {
392 .ident = MAC_MODEL_Q605_ACC,
393 .name = "Quadra 605",
394 .adb_type = MAC_ADB_CUDA,
395 .via_type = MAC_VIA_QUADRA,
396 .scsi_type = MAC_SCSI_QUADRA,
397 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100398 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100399 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700400 }, {
401 .ident = MAC_MODEL_Q610,
402 .name = "Quadra 610",
403 .adb_type = MAC_ADB_II,
404 .via_type = MAC_VIA_QUADRA,
405 .scsi_type = MAC_SCSI_QUADRA,
406 .scc_type = MAC_SCC_QUADRA,
407 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100408 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100409 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700410 }, {
411 .ident = MAC_MODEL_Q630,
412 .name = "Quadra 630",
413 .adb_type = MAC_ADB_CUDA,
414 .via_type = MAC_VIA_QUADRA,
415 .scsi_type = MAC_SCSI_QUADRA,
416 .ide_type = MAC_IDE_QUADRA,
417 .scc_type = MAC_SCC_QUADRA,
418 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100419 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100420 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700421 }, {
422 .ident = MAC_MODEL_Q650,
423 .name = "Quadra 650",
424 .adb_type = MAC_ADB_II,
425 .via_type = MAC_VIA_QUADRA,
426 .scsi_type = MAC_SCSI_QUADRA,
427 .scc_type = MAC_SCC_QUADRA,
428 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100429 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100430 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700431 },
Finn Thain53aac0a2009-11-04 00:39:09 +1100432 /* The Q700 does have a NS Sonic */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700433 {
434 .ident = MAC_MODEL_Q700,
435 .name = "Quadra 700",
436 .adb_type = MAC_ADB_II,
437 .via_type = MAC_VIA_QUADRA,
438 .scsi_type = MAC_SCSI_QUADRA2,
439 .scc_type = MAC_SCC_QUADRA,
440 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100441 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100442 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700443 }, {
444 .ident = MAC_MODEL_Q800,
445 .name = "Quadra 800",
446 .adb_type = MAC_ADB_II,
447 .via_type = MAC_VIA_QUADRA,
448 .scsi_type = MAC_SCSI_QUADRA,
449 .scc_type = MAC_SCC_QUADRA,
450 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100451 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100452 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700453 }, {
454 .ident = MAC_MODEL_Q840,
455 .name = "Quadra 840AV",
456 .adb_type = MAC_ADB_CUDA,
457 .via_type = MAC_VIA_QUADRA,
458 .scsi_type = MAC_SCSI_QUADRA3,
459 .scc_type = MAC_SCC_PSC,
460 .ether_type = MAC_ETHER_MACE,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100461 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100462 .floppy_type = MAC_FLOPPY_AV,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700463 }, {
464 .ident = MAC_MODEL_Q900,
465 .name = "Quadra 900",
466 .adb_type = MAC_ADB_IOP,
467 .via_type = MAC_VIA_QUADRA,
468 .scsi_type = MAC_SCSI_QUADRA2,
469 .scc_type = MAC_SCC_IOP,
470 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100471 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100472 .floppy_type = MAC_FLOPPY_SWIM_IOP,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700473 }, {
474 .ident = MAC_MODEL_Q950,
475 .name = "Quadra 950",
476 .adb_type = MAC_ADB_IOP,
477 .via_type = MAC_VIA_QUADRA,
478 .scsi_type = MAC_SCSI_QUADRA2,
479 .scc_type = MAC_SCC_IOP,
480 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100481 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100482 .floppy_type = MAC_FLOPPY_SWIM_IOP,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700483 },
484
485 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100486 * Performa - more LC type machines
Linus Torvalds1da177e2005-04-16 15:20:36 -0700487 */
488
489 {
490 .ident = MAC_MODEL_P460,
Finn Thain53aac0a2009-11-04 00:39:09 +1100491 .name = "Performa 460",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700492 .adb_type = MAC_ADB_IISI,
493 .via_type = MAC_VIA_IIci,
494 .scsi_type = MAC_SCSI_OLD,
495 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100496 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100497 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700498 }, {
499 .ident = MAC_MODEL_P475,
Finn Thain53aac0a2009-11-04 00:39:09 +1100500 .name = "Performa 475",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700501 .adb_type = MAC_ADB_CUDA,
502 .via_type = MAC_VIA_QUADRA,
503 .scsi_type = MAC_SCSI_QUADRA,
504 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100505 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100506 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700507 }, {
508 .ident = MAC_MODEL_P475F,
Finn Thain53aac0a2009-11-04 00:39:09 +1100509 .name = "Performa 475",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700510 .adb_type = MAC_ADB_CUDA,
511 .via_type = MAC_VIA_QUADRA,
512 .scsi_type = MAC_SCSI_QUADRA,
513 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100514 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100515 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700516 }, {
517 .ident = MAC_MODEL_P520,
Finn Thain53aac0a2009-11-04 00:39:09 +1100518 .name = "Performa 520",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700519 .adb_type = MAC_ADB_CUDA,
520 .via_type = MAC_VIA_IIci,
521 .scsi_type = MAC_SCSI_OLD,
522 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100523 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100524 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700525 }, {
526 .ident = MAC_MODEL_P550,
Finn Thain53aac0a2009-11-04 00:39:09 +1100527 .name = "Performa 550",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700528 .adb_type = MAC_ADB_CUDA,
529 .via_type = MAC_VIA_IIci,
530 .scsi_type = MAC_SCSI_OLD,
531 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100532 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100533 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700534 },
Finn Thain53aac0a2009-11-04 00:39:09 +1100535 /* These have the comm slot, and therefore possibly SONIC ethernet */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700536 {
537 .ident = MAC_MODEL_P575,
538 .name = "Performa 575",
539 .adb_type = MAC_ADB_CUDA,
540 .via_type = MAC_VIA_QUADRA,
541 .scsi_type = MAC_SCSI_QUADRA,
542 .scc_type = MAC_SCC_II,
543 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100544 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100545 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700546 }, {
547 .ident = MAC_MODEL_P588,
548 .name = "Performa 588",
549 .adb_type = MAC_ADB_CUDA,
550 .via_type = MAC_VIA_QUADRA,
551 .scsi_type = MAC_SCSI_QUADRA,
552 .ide_type = MAC_IDE_QUADRA,
553 .scc_type = MAC_SCC_II,
554 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100555 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100556 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700557 }, {
558 .ident = MAC_MODEL_TV,
559 .name = "TV",
560 .adb_type = MAC_ADB_CUDA,
561 .via_type = MAC_VIA_QUADRA,
562 .scsi_type = MAC_SCSI_OLD,
563 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100564 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100565 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700566 }, {
567 .ident = MAC_MODEL_P600,
568 .name = "Performa 600",
569 .adb_type = MAC_ADB_IISI,
570 .via_type = MAC_VIA_IIci,
571 .scsi_type = MAC_SCSI_OLD,
572 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100573 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100574 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700575 },
576
577 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100578 * Centris - just guessing again; maybe like Quadra.
579 * The C610 may or may not have SONIC. We probe to make sure.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700580 */
581
Linus Torvalds1da177e2005-04-16 15:20:36 -0700582 {
583 .ident = MAC_MODEL_C610,
584 .name = "Centris 610",
585 .adb_type = MAC_ADB_II,
586 .via_type = MAC_VIA_QUADRA,
587 .scsi_type = MAC_SCSI_QUADRA,
588 .scc_type = MAC_SCC_QUADRA,
589 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100590 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100591 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700592 }, {
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,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100600 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100601 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700602 }, {
603 .ident = MAC_MODEL_C660,
604 .name = "Centris 660AV",
605 .adb_type = MAC_ADB_CUDA,
606 .via_type = MAC_VIA_QUADRA,
607 .scsi_type = MAC_SCSI_QUADRA3,
608 .scc_type = MAC_SCC_PSC,
609 .ether_type = MAC_ETHER_MACE,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100610 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100611 .floppy_type = MAC_FLOPPY_AV,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700612 },
613
614 /*
615 * The PowerBooks all the same "Combo" custom IC for SCSI and SCC
616 * and a PMU (in two variations?) for ADB. Most of them use the
617 * Quadra-style VIAs. A few models also have IDE from hell.
618 */
619
620 {
621 .ident = MAC_MODEL_PB140,
622 .name = "PowerBook 140",
623 .adb_type = MAC_ADB_PB1,
624 .via_type = MAC_VIA_QUADRA,
625 .scsi_type = MAC_SCSI_OLD,
626 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100627 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100628 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700629 }, {
630 .ident = MAC_MODEL_PB145,
631 .name = "PowerBook 145",
632 .adb_type = MAC_ADB_PB1,
633 .via_type = MAC_VIA_QUADRA,
634 .scsi_type = MAC_SCSI_OLD,
635 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100636 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100637 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700638 }, {
639 .ident = MAC_MODEL_PB150,
640 .name = "PowerBook 150",
641 .adb_type = MAC_ADB_PB1,
642 .via_type = MAC_VIA_IIci,
643 .scsi_type = MAC_SCSI_OLD,
644 .ide_type = MAC_IDE_PB,
645 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100646 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100647 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700648 }, {
649 .ident = MAC_MODEL_PB160,
650 .name = "PowerBook 160",
651 .adb_type = MAC_ADB_PB1,
652 .via_type = MAC_VIA_QUADRA,
653 .scsi_type = MAC_SCSI_OLD,
654 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100655 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100656 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700657 }, {
658 .ident = MAC_MODEL_PB165,
659 .name = "PowerBook 165",
660 .adb_type = MAC_ADB_PB1,
661 .via_type = MAC_VIA_QUADRA,
662 .scsi_type = MAC_SCSI_OLD,
663 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100664 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100665 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700666 }, {
667 .ident = MAC_MODEL_PB165C,
668 .name = "PowerBook 165c",
669 .adb_type = MAC_ADB_PB1,
670 .via_type = MAC_VIA_QUADRA,
671 .scsi_type = MAC_SCSI_OLD,
672 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100673 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100674 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700675 }, {
676 .ident = MAC_MODEL_PB170,
677 .name = "PowerBook 170",
678 .adb_type = MAC_ADB_PB1,
679 .via_type = MAC_VIA_QUADRA,
680 .scsi_type = MAC_SCSI_OLD,
681 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100682 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100683 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700684 }, {
685 .ident = MAC_MODEL_PB180,
686 .name = "PowerBook 180",
687 .adb_type = MAC_ADB_PB1,
688 .via_type = MAC_VIA_QUADRA,
689 .scsi_type = MAC_SCSI_OLD,
690 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100691 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100692 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700693 }, {
694 .ident = MAC_MODEL_PB180C,
695 .name = "PowerBook 180c",
696 .adb_type = MAC_ADB_PB1,
697 .via_type = MAC_VIA_QUADRA,
698 .scsi_type = MAC_SCSI_OLD,
699 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100700 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100701 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700702 }, {
703 .ident = MAC_MODEL_PB190,
704 .name = "PowerBook 190",
705 .adb_type = MAC_ADB_PB2,
706 .via_type = MAC_VIA_QUADRA,
707 .scsi_type = MAC_SCSI_OLD,
708 .ide_type = MAC_IDE_BABOON,
709 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100710 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100711 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700712 }, {
713 .ident = MAC_MODEL_PB520,
714 .name = "PowerBook 520",
715 .adb_type = MAC_ADB_PB2,
716 .via_type = MAC_VIA_QUADRA,
717 .scsi_type = MAC_SCSI_OLD,
718 .scc_type = MAC_SCC_QUADRA,
719 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100720 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100721 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700722 },
723
724 /*
725 * PowerBook Duos are pretty much like normal PowerBooks
726 * All of these probably have onboard SONIC in the Dock which
727 * means we'll have to probe for it eventually.
728 *
Simon Arlott0c79cf62007-10-20 01:20:32 +0200729 * Are these really MAC_VIA_IIci? The developer notes for the
Linus Torvalds1da177e2005-04-16 15:20:36 -0700730 * Duos show pretty much the same custom parts as in most of
731 * the other PowerBooks which would imply MAC_VIA_QUADRA.
732 */
733
734 {
735 .ident = MAC_MODEL_PB210,
736 .name = "PowerBook Duo 210",
737 .adb_type = MAC_ADB_PB2,
738 .via_type = MAC_VIA_IIci,
739 .scsi_type = MAC_SCSI_OLD,
740 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100741 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100742 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700743 }, {
744 .ident = MAC_MODEL_PB230,
745 .name = "PowerBook Duo 230",
746 .adb_type = MAC_ADB_PB2,
747 .via_type = MAC_VIA_IIci,
748 .scsi_type = MAC_SCSI_OLD,
749 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100750 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100751 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700752 }, {
753 .ident = MAC_MODEL_PB250,
754 .name = "PowerBook Duo 250",
755 .adb_type = MAC_ADB_PB2,
756 .via_type = MAC_VIA_IIci,
757 .scsi_type = MAC_SCSI_OLD,
758 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100759 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100760 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700761 }, {
762 .ident = MAC_MODEL_PB270C,
763 .name = "PowerBook Duo 270c",
764 .adb_type = MAC_ADB_PB2,
765 .via_type = MAC_VIA_IIci,
766 .scsi_type = MAC_SCSI_OLD,
767 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100768 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100769 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700770 }, {
771 .ident = MAC_MODEL_PB280,
772 .name = "PowerBook Duo 280",
773 .adb_type = MAC_ADB_PB2,
774 .via_type = MAC_VIA_IIci,
775 .scsi_type = MAC_SCSI_OLD,
776 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100777 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100778 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700779 }, {
780 .ident = MAC_MODEL_PB280C,
781 .name = "PowerBook Duo 280c",
782 .adb_type = MAC_ADB_PB2,
783 .via_type = MAC_VIA_IIci,
784 .scsi_type = MAC_SCSI_OLD,
785 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100786 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100787 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700788 },
789
790 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100791 * Other stuff?
Linus Torvalds1da177e2005-04-16 15:20:36 -0700792 */
Finn Thain53aac0a2009-11-04 00:39:09 +1100793
Linus Torvalds1da177e2005-04-16 15:20:36 -0700794 {
795 .ident = -1
796 }
797};
798
Adrian Bunk8dfbdf42008-07-17 21:16:25 +0200799static void __init mac_identify(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700800{
801 struct mac_model *m;
802
803 /* Penguin data useful? */
804 int model = mac_bi_data.id;
805 if (!model) {
806 /* no bootinfo model id -> NetBSD booter was used! */
807 /* XXX FIXME: breaks for model > 31 */
Roman Zippel6ff58012007-05-01 22:32:43 +0200808 model = (mac_bi_data.cpuid >> 2) & 63;
Finn Thain53aac0a2009-11-04 00:39:09 +1100809 printk(KERN_WARNING "No bootinfo model ID, using cpuid instead "
810 "(obsolete bootloader?)\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700811 }
812
813 macintosh_config = mac_data_table;
Roman Zippel6ff58012007-05-01 22:32:43 +0200814 for (m = macintosh_config; m->ident != -1; m++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700815 if (m->ident == model) {
816 macintosh_config = m;
817 break;
818 }
819 }
820
Finn Thain53aac0a2009-11-04 00:39:09 +1100821 /*
822 * We need to pre-init the IOPs, if any. Otherwise
823 * the serial console won't work if the user had
824 * the serial ports set to "Faster" mode in MacOS.
825 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700826 iop_preinit();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700827
Roman Zippel6ff58012007-05-01 22:32:43 +0200828 printk(KERN_INFO "Detected Macintosh model: %d \n", model);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700829
830 /*
831 * Report booter data:
832 */
Roman Zippel6ff58012007-05-01 22:32:43 +0200833 printk(KERN_DEBUG " Penguin bootinfo data:\n");
Finn Thain53aac0a2009-11-04 00:39:09 +1100834 printk(KERN_DEBUG " Video: addr 0x%lx "
835 "row 0x%lx depth %lx dimensions %ld x %ld\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700836 mac_bi_data.videoaddr, mac_bi_data.videorow,
837 mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF,
838 mac_bi_data.dimensions >> 16);
Roman Zippel6ff58012007-05-01 22:32:43 +0200839 printk(KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx \n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700840 mac_bi_data.videological, mac_orig_videoaddr,
841 mac_bi_data.sccbase);
Roman Zippel6ff58012007-05-01 22:32:43 +0200842 printk(KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx \n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700843 mac_bi_data.boottime, mac_bi_data.gmtbias);
Roman Zippel6ff58012007-05-01 22:32:43 +0200844 printk(KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx \n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700845 mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700846
Linus Torvalds1da177e2005-04-16 15:20:36 -0700847 iop_init();
848 via_init();
849 oss_init();
850 psc_init();
851 baboon_init();
852}
853
Adrian Bunk8dfbdf42008-07-17 21:16:25 +0200854static void __init mac_report_hardware(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700855{
856 printk(KERN_INFO "Apple Macintosh %s\n", macintosh_config->name);
857}
858
859static void mac_get_model(char *str)
860{
Roman Zippel6ff58012007-05-01 22:32:43 +0200861 strcpy(str, "Macintosh ");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700862 strcat(str, macintosh_config->name);
863}
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100864
865static struct resource swim_resources[1];
866
867static struct platform_device swim_device = {
868 .name = "swim",
869 .id = -1,
870 .num_resources = ARRAY_SIZE(swim_resources),
871 .resource = swim_resources,
872};
873
874static struct platform_device *mac_platform_devices[] __initdata = {
875 &swim_device
876};
877
878int __init mac_platform_init(void)
879{
880 u8 *swim_base;
881
882 switch (macintosh_config->floppy_type) {
883 case MAC_FLOPPY_SWIM_ADDR1:
884 swim_base = (u8 *)(VIA1_BASE + 0x1E000);
885 break;
886 case MAC_FLOPPY_SWIM_ADDR2:
887 swim_base = (u8 *)(VIA1_BASE + 0x16000);
888 break;
889 default:
890 return 0;
891 }
892
893 swim_resources[0].name = "swim-regs";
894 swim_resources[0].start = (resource_size_t)swim_base;
895 swim_resources[0].end = (resource_size_t)(swim_base + SWIM_IO_SIZE);
896 swim_resources[0].flags = IORESOURCE_MEM;
897
898 return platform_add_devices(mac_platform_devices,
899 ARRAY_SIZE(mac_platform_devices));
900}
901
902arch_initcall(mac_platform_init);