blob: 1c16b1baf8dbf9e7b03f22cd663192c83aa07cf7 [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>
Finn Thain18814ee2009-11-17 20:03:05 +110026#include <linux/adb.h>
27#include <linux/cuda.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070028
29#define BOOTINFO_COMPAT_1_0
30#include <asm/setup.h>
31#include <asm/bootinfo.h>
32
33#include <asm/system.h>
34#include <asm/io.h>
35#include <asm/irq.h>
36#include <asm/pgtable.h>
37#include <asm/rtc.h>
38#include <asm/machdep.h>
39
40#include <asm/macintosh.h>
41#include <asm/macints.h>
42#include <asm/machw.h>
43
44#include <asm/mac_iop.h>
45#include <asm/mac_via.h>
46#include <asm/mac_oss.h>
47#include <asm/mac_psc.h>
48
49/* Mac bootinfo struct */
Linus Torvalds1da177e2005-04-16 15:20:36 -070050struct mac_booter_data mac_bi_data;
Linus Torvalds1da177e2005-04-16 15:20:36 -070051
Linus Torvalds1da177e2005-04-16 15:20:36 -070052/* The phys. video addr. - might be bogus on some machines */
Adrian Bunk8dfbdf42008-07-17 21:16:25 +020053static unsigned long mac_orig_videoaddr;
Linus Torvalds1da177e2005-04-16 15:20:36 -070054
55/* Mac specific timer functions */
Roman Zippel6ff58012007-05-01 22:32:43 +020056extern unsigned long mac_gettimeoffset(void);
57extern int mac_hwclk(int, struct rtc_time *);
58extern int mac_set_clock_mmss(unsigned long);
Linus Torvalds1da177e2005-04-16 15:20:36 -070059extern void iop_preinit(void);
60extern void iop_init(void);
61extern void via_init(void);
David Howells40220c12006-10-09 12:19:47 +010062extern void via_init_clock(irq_handler_t func);
Linus Torvalds1da177e2005-04-16 15:20:36 -070063extern void via_flush_cache(void);
64extern void oss_init(void);
65extern void psc_init(void);
66extern void baboon_init(void);
67
68extern void mac_mksound(unsigned int, unsigned int);
69
Linus Torvalds1da177e2005-04-16 15:20:36 -070070static void mac_get_model(char *str);
Adrian Bunk8dfbdf42008-07-17 21:16:25 +020071static void mac_identify(void);
72static void mac_report_hardware(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070073
Al Viro66a3f822007-07-20 04:33:28 +010074static void __init mac_sched_init(irq_handler_t vector)
Linus Torvalds1da177e2005-04-16 15:20:36 -070075{
76 via_init_clock(vector);
77}
78
Linus Torvalds1da177e2005-04-16 15:20:36 -070079/*
80 * Parse a Macintosh-specific record in the bootinfo
81 */
82
83int __init mac_parse_bootinfo(const struct bi_record *record)
84{
Roman Zippel6ff58012007-05-01 22:32:43 +020085 int unknown = 0;
86 const u_long *data = record->data;
Linus Torvalds1da177e2005-04-16 15:20:36 -070087
Roman Zippel6ff58012007-05-01 22:32:43 +020088 switch (record->tag) {
Linus Torvalds1da177e2005-04-16 15:20:36 -070089 case BI_MAC_MODEL:
Roman Zippel6ff58012007-05-01 22:32:43 +020090 mac_bi_data.id = *data;
91 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -070092 case BI_MAC_VADDR:
Roman Zippel6ff58012007-05-01 22:32:43 +020093 mac_bi_data.videoaddr = *data;
94 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -070095 case BI_MAC_VDEPTH:
Roman Zippel6ff58012007-05-01 22:32:43 +020096 mac_bi_data.videodepth = *data;
97 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -070098 case BI_MAC_VROW:
Roman Zippel6ff58012007-05-01 22:32:43 +020099 mac_bi_data.videorow = *data;
100 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700101 case BI_MAC_VDIM:
Roman Zippel6ff58012007-05-01 22:32:43 +0200102 mac_bi_data.dimensions = *data;
103 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700104 case BI_MAC_VLOGICAL:
Roman Zippel6ff58012007-05-01 22:32:43 +0200105 mac_bi_data.videological = VIDEOMEMBASE + (*data & ~VIDEOMEMMASK);
106 mac_orig_videoaddr = *data;
107 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108 case BI_MAC_SCCBASE:
Roman Zippel6ff58012007-05-01 22:32:43 +0200109 mac_bi_data.sccbase = *data;
110 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700111 case BI_MAC_BTIME:
Roman Zippel6ff58012007-05-01 22:32:43 +0200112 mac_bi_data.boottime = *data;
113 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700114 case BI_MAC_GMTBIAS:
Roman Zippel6ff58012007-05-01 22:32:43 +0200115 mac_bi_data.gmtbias = *data;
116 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700117 case BI_MAC_MEMSIZE:
Roman Zippel6ff58012007-05-01 22:32:43 +0200118 mac_bi_data.memsize = *data;
119 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120 case BI_MAC_CPUID:
Roman Zippel6ff58012007-05-01 22:32:43 +0200121 mac_bi_data.cpuid = *data;
122 break;
123 case BI_MAC_ROMBASE:
124 mac_bi_data.rombase = *data;
125 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700126 default:
Roman Zippel6ff58012007-05-01 22:32:43 +0200127 unknown = 1;
128 break;
129 }
130 return unknown;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700131}
132
133/*
134 * Flip into 24bit mode for an instant - flushes the L2 cache card. We
135 * have to disable interrupts for this. Our IRQ handlers will crap
136 * themselves if they take an IRQ in 24bit mode!
137 */
138
139static void mac_cache_card_flush(int writeback)
140{
141 unsigned long flags;
Roman Zippel6ff58012007-05-01 22:32:43 +0200142
Linus Torvalds1da177e2005-04-16 15:20:36 -0700143 local_irq_save(flags);
144 via_flush_cache();
145 local_irq_restore(flags);
146}
147
148void __init config_mac(void)
149{
Roman Zippel6ff58012007-05-01 22:32:43 +0200150 if (!MACH_IS_MAC)
Frans Popb9b0d8b2010-02-06 18:47:11 +0100151 printk(KERN_ERR "ERROR: no Mac, but config_mac() called!!\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700152
Roman Zippel6ff58012007-05-01 22:32:43 +0200153 mach_sched_init = mac_sched_init;
154 mach_init_IRQ = mac_init_IRQ;
155 mach_get_model = mac_get_model;
156 mach_gettimeoffset = mac_gettimeoffset;
Roman Zippel6ff58012007-05-01 22:32:43 +0200157 mach_hwclk = mac_hwclk;
Roman Zippel6ff58012007-05-01 22:32:43 +0200158 mach_set_clock_mmss = mac_set_clock_mmss;
159 mach_reset = mac_reset;
160 mach_halt = mac_poweroff;
161 mach_power_off = mac_poweroff;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700162 mach_max_dma_address = 0xffffffff;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700163#if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE)
Roman Zippel6ff58012007-05-01 22:32:43 +0200164 mach_beep = mac_mksound;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700165#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700166
167 /*
168 * Determine hardware present
169 */
170
171 mac_identify();
172 mac_report_hardware();
173
Roman Zippel6ff58012007-05-01 22:32:43 +0200174 /*
175 * AFAIK only the IIci takes a cache card. The IIfx has onboard
176 * cache ... someone needs to figure out how to tell if it's on or
177 * not.
178 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700179
180 if (macintosh_config->ident == MAC_MODEL_IICI
Roman Zippel6ff58012007-05-01 22:32:43 +0200181 || macintosh_config->ident == MAC_MODEL_IIFX)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700182 mach_l2_flush = mac_cache_card_flush;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700183}
184
185
186/*
Finn Thain53aac0a2009-11-04 00:39:09 +1100187 * Macintosh Table: hardcoded model configuration data.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700188 *
Finn Thain53aac0a2009-11-04 00:39:09 +1100189 * Much of this was defined by Alan, based on who knows what docs.
190 * I've added a lot more, and some of that was pure guesswork based
191 * on hardware pages present on the Mac web site. Possibly wildly
192 * inaccurate, so look here if a new Mac model won't run. Example: if
193 * a Mac crashes immediately after the VIA1 registers have been dumped
194 * to the screen, it probably died attempting to read DirB on a RBV.
195 * Meaning it should have MAC_VIA_IIci here :-)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700196 */
197
198struct mac_model *macintosh_config;
199EXPORT_SYMBOL(macintosh_config);
200
Roman Zippel6ff58012007-05-01 22:32:43 +0200201static struct mac_model mac_data_table[] = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700202 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100203 * We'll pretend to be a Macintosh II, that's pretty safe.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700204 */
205
206 {
207 .ident = MAC_MODEL_II,
208 .name = "Unknown",
209 .adb_type = MAC_ADB_II,
210 .via_type = MAC_VIA_II,
211 .scsi_type = MAC_SCSI_OLD,
212 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100213 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100214 .floppy_type = MAC_FLOPPY_IWM,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700215 },
216
217 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100218 * Original Mac II hardware
Linus Torvalds1da177e2005-04-16 15:20:36 -0700219 */
220
221 {
222 .ident = MAC_MODEL_II,
223 .name = "II",
224 .adb_type = MAC_ADB_II,
225 .via_type = MAC_VIA_II,
226 .scsi_type = MAC_SCSI_OLD,
227 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100228 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100229 .floppy_type = MAC_FLOPPY_IWM,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700230 }, {
231 .ident = MAC_MODEL_IIX,
232 .name = "IIx",
233 .adb_type = MAC_ADB_II,
234 .via_type = MAC_VIA_II,
235 .scsi_type = MAC_SCSI_OLD,
236 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100237 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100238 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700239 }, {
240 .ident = MAC_MODEL_IICX,
241 .name = "IIcx",
242 .adb_type = MAC_ADB_II,
243 .via_type = MAC_VIA_II,
244 .scsi_type = MAC_SCSI_OLD,
245 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100246 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100247 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700248 }, {
249 .ident = MAC_MODEL_SE30,
250 .name = "SE/30",
251 .adb_type = MAC_ADB_II,
252 .via_type = MAC_VIA_II,
253 .scsi_type = MAC_SCSI_OLD,
254 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100255 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100256 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700257 },
258
259 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100260 * Weirdified Mac II hardware - all subtly different. Gee thanks
261 * Apple. All these boxes seem to have VIA2 in a different place to
262 * the Mac II (+1A000 rather than +4000)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700263 * CSA: see http://developer.apple.com/technotes/hw/hw_09.html
264 */
265
266 {
267 .ident = MAC_MODEL_IICI,
268 .name = "IIci",
269 .adb_type = MAC_ADB_II,
270 .via_type = MAC_VIA_IIci,
271 .scsi_type = MAC_SCSI_OLD,
272 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100273 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100274 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700275 }, {
276 .ident = MAC_MODEL_IIFX,
277 .name = "IIfx",
278 .adb_type = MAC_ADB_IOP,
279 .via_type = MAC_VIA_IIci,
280 .scsi_type = MAC_SCSI_OLD,
281 .scc_type = MAC_SCC_IOP,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100282 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100283 .floppy_type = MAC_FLOPPY_SWIM_IOP,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700284 }, {
285 .ident = MAC_MODEL_IISI,
286 .name = "IIsi",
287 .adb_type = MAC_ADB_IISI,
288 .via_type = MAC_VIA_IIci,
289 .scsi_type = MAC_SCSI_OLD,
290 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100291 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100292 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700293 }, {
294 .ident = MAC_MODEL_IIVI,
295 .name = "IIvi",
296 .adb_type = MAC_ADB_IISI,
297 .via_type = MAC_VIA_IIci,
298 .scsi_type = MAC_SCSI_OLD,
299 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100300 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100301 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700302 }, {
303 .ident = MAC_MODEL_IIVX,
304 .name = "IIvx",
305 .adb_type = MAC_ADB_IISI,
306 .via_type = MAC_VIA_IIci,
307 .scsi_type = MAC_SCSI_OLD,
308 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100309 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100310 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700311 },
312
313 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100314 * Classic models (guessing: similar to SE/30? Nope, similar to LC...)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700315 */
316
317 {
318 .ident = MAC_MODEL_CLII,
319 .name = "Classic II",
320 .adb_type = MAC_ADB_IISI,
321 .via_type = MAC_VIA_IIci,
322 .scsi_type = MAC_SCSI_OLD,
323 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100324 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100325 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700326 }, {
327 .ident = MAC_MODEL_CCL,
328 .name = "Color Classic",
329 .adb_type = MAC_ADB_CUDA,
330 .via_type = MAC_VIA_IIci,
331 .scsi_type = MAC_SCSI_OLD,
332 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100333 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100334 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100335 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700336
337 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100338 * Some Mac LC machines. Basically the same as the IIci, ADB like IIsi
Linus Torvalds1da177e2005-04-16 15:20:36 -0700339 */
340
341 {
342 .ident = MAC_MODEL_LC,
343 .name = "LC",
344 .adb_type = MAC_ADB_IISI,
345 .via_type = MAC_VIA_IIci,
346 .scsi_type = MAC_SCSI_OLD,
347 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100348 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100349 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700350 }, {
351 .ident = MAC_MODEL_LCII,
352 .name = "LC II",
353 .adb_type = MAC_ADB_IISI,
354 .via_type = MAC_VIA_IIci,
355 .scsi_type = MAC_SCSI_OLD,
356 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100357 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100358 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700359 }, {
360 .ident = MAC_MODEL_LCIII,
361 .name = "LC III",
362 .adb_type = MAC_ADB_IISI,
363 .via_type = MAC_VIA_IIci,
364 .scsi_type = MAC_SCSI_OLD,
365 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100366 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100367 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700368 },
369
370 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100371 * Quadra. Video is at 0xF9000000, via is like a MacII. We label it
372 * differently as some of the stuff connected to VIA2 seems different.
373 * Better SCSI chip and onboard ethernet using a NatSemi SONIC except
374 * the 660AV and 840AV which use an AMD 79C940 (MACE).
375 * The 700, 900 and 950 have some I/O chips in the wrong place to
376 * confuse us. The 840AV has a SCSI location of its own (same as
377 * the 660AV).
Linus Torvalds1da177e2005-04-16 15:20:36 -0700378 */
379
380 {
381 .ident = MAC_MODEL_Q605,
382 .name = "Quadra 605",
383 .adb_type = MAC_ADB_CUDA,
384 .via_type = MAC_VIA_QUADRA,
385 .scsi_type = MAC_SCSI_QUADRA,
386 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100387 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100388 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700389 }, {
390 .ident = MAC_MODEL_Q605_ACC,
391 .name = "Quadra 605",
392 .adb_type = MAC_ADB_CUDA,
393 .via_type = MAC_VIA_QUADRA,
394 .scsi_type = MAC_SCSI_QUADRA,
395 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100396 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100397 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700398 }, {
399 .ident = MAC_MODEL_Q610,
400 .name = "Quadra 610",
401 .adb_type = MAC_ADB_II,
402 .via_type = MAC_VIA_QUADRA,
403 .scsi_type = MAC_SCSI_QUADRA,
404 .scc_type = MAC_SCC_QUADRA,
405 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100406 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100407 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700408 }, {
409 .ident = MAC_MODEL_Q630,
410 .name = "Quadra 630",
411 .adb_type = MAC_ADB_CUDA,
412 .via_type = MAC_VIA_QUADRA,
413 .scsi_type = MAC_SCSI_QUADRA,
414 .ide_type = MAC_IDE_QUADRA,
415 .scc_type = MAC_SCC_QUADRA,
416 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100417 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100418 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700419 }, {
420 .ident = MAC_MODEL_Q650,
421 .name = "Quadra 650",
422 .adb_type = MAC_ADB_II,
423 .via_type = MAC_VIA_QUADRA,
424 .scsi_type = MAC_SCSI_QUADRA,
425 .scc_type = MAC_SCC_QUADRA,
426 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100427 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100428 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700429 },
Finn Thain53aac0a2009-11-04 00:39:09 +1100430 /* The Q700 does have a NS Sonic */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700431 {
432 .ident = MAC_MODEL_Q700,
433 .name = "Quadra 700",
434 .adb_type = MAC_ADB_II,
435 .via_type = MAC_VIA_QUADRA,
436 .scsi_type = MAC_SCSI_QUADRA2,
437 .scc_type = MAC_SCC_QUADRA,
438 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100439 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100440 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700441 }, {
442 .ident = MAC_MODEL_Q800,
443 .name = "Quadra 800",
444 .adb_type = MAC_ADB_II,
445 .via_type = MAC_VIA_QUADRA,
446 .scsi_type = MAC_SCSI_QUADRA,
447 .scc_type = MAC_SCC_QUADRA,
448 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100449 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100450 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700451 }, {
452 .ident = MAC_MODEL_Q840,
453 .name = "Quadra 840AV",
454 .adb_type = MAC_ADB_CUDA,
455 .via_type = MAC_VIA_QUADRA,
456 .scsi_type = MAC_SCSI_QUADRA3,
457 .scc_type = MAC_SCC_PSC,
458 .ether_type = MAC_ETHER_MACE,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100459 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100460 .floppy_type = MAC_FLOPPY_AV,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700461 }, {
462 .ident = MAC_MODEL_Q900,
463 .name = "Quadra 900",
464 .adb_type = MAC_ADB_IOP,
465 .via_type = MAC_VIA_QUADRA,
466 .scsi_type = MAC_SCSI_QUADRA2,
467 .scc_type = MAC_SCC_IOP,
468 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100469 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100470 .floppy_type = MAC_FLOPPY_SWIM_IOP,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700471 }, {
472 .ident = MAC_MODEL_Q950,
473 .name = "Quadra 950",
474 .adb_type = MAC_ADB_IOP,
475 .via_type = MAC_VIA_QUADRA,
476 .scsi_type = MAC_SCSI_QUADRA2,
477 .scc_type = MAC_SCC_IOP,
478 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100479 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100480 .floppy_type = MAC_FLOPPY_SWIM_IOP,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700481 },
482
483 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100484 * Performa - more LC type machines
Linus Torvalds1da177e2005-04-16 15:20:36 -0700485 */
486
487 {
488 .ident = MAC_MODEL_P460,
Finn Thain53aac0a2009-11-04 00:39:09 +1100489 .name = "Performa 460",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700490 .adb_type = MAC_ADB_IISI,
491 .via_type = MAC_VIA_IIci,
492 .scsi_type = MAC_SCSI_OLD,
493 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100494 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100495 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700496 }, {
497 .ident = MAC_MODEL_P475,
Finn Thain53aac0a2009-11-04 00:39:09 +1100498 .name = "Performa 475",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700499 .adb_type = MAC_ADB_CUDA,
500 .via_type = MAC_VIA_QUADRA,
501 .scsi_type = MAC_SCSI_QUADRA,
502 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100503 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100504 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700505 }, {
506 .ident = MAC_MODEL_P475F,
Finn Thain53aac0a2009-11-04 00:39:09 +1100507 .name = "Performa 475",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700508 .adb_type = MAC_ADB_CUDA,
509 .via_type = MAC_VIA_QUADRA,
510 .scsi_type = MAC_SCSI_QUADRA,
511 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100512 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100513 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700514 }, {
515 .ident = MAC_MODEL_P520,
Finn Thain53aac0a2009-11-04 00:39:09 +1100516 .name = "Performa 520",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700517 .adb_type = MAC_ADB_CUDA,
518 .via_type = MAC_VIA_IIci,
519 .scsi_type = MAC_SCSI_OLD,
520 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100521 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100522 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700523 }, {
524 .ident = MAC_MODEL_P550,
Finn Thain53aac0a2009-11-04 00:39:09 +1100525 .name = "Performa 550",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700526 .adb_type = MAC_ADB_CUDA,
527 .via_type = MAC_VIA_IIci,
528 .scsi_type = MAC_SCSI_OLD,
529 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100530 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100531 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700532 },
Finn Thain53aac0a2009-11-04 00:39:09 +1100533 /* These have the comm slot, and therefore possibly SONIC ethernet */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700534 {
535 .ident = MAC_MODEL_P575,
536 .name = "Performa 575",
537 .adb_type = MAC_ADB_CUDA,
538 .via_type = MAC_VIA_QUADRA,
539 .scsi_type = MAC_SCSI_QUADRA,
540 .scc_type = MAC_SCC_II,
541 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100542 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100543 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700544 }, {
545 .ident = MAC_MODEL_P588,
546 .name = "Performa 588",
547 .adb_type = MAC_ADB_CUDA,
548 .via_type = MAC_VIA_QUADRA,
549 .scsi_type = MAC_SCSI_QUADRA,
550 .ide_type = MAC_IDE_QUADRA,
551 .scc_type = MAC_SCC_II,
552 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100553 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100554 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700555 }, {
556 .ident = MAC_MODEL_TV,
557 .name = "TV",
558 .adb_type = MAC_ADB_CUDA,
559 .via_type = MAC_VIA_QUADRA,
560 .scsi_type = MAC_SCSI_OLD,
561 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100562 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100563 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700564 }, {
565 .ident = MAC_MODEL_P600,
566 .name = "Performa 600",
567 .adb_type = MAC_ADB_IISI,
568 .via_type = MAC_VIA_IIci,
569 .scsi_type = MAC_SCSI_OLD,
570 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100571 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100572 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700573 },
574
575 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100576 * Centris - just guessing again; maybe like Quadra.
577 * The C610 may or may not have SONIC. We probe to make sure.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700578 */
579
Linus Torvalds1da177e2005-04-16 15:20:36 -0700580 {
581 .ident = MAC_MODEL_C610,
582 .name = "Centris 610",
583 .adb_type = MAC_ADB_II,
584 .via_type = MAC_VIA_QUADRA,
585 .scsi_type = MAC_SCSI_QUADRA,
586 .scc_type = MAC_SCC_QUADRA,
587 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100588 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100589 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700590 }, {
591 .ident = MAC_MODEL_C650,
592 .name = "Centris 650",
593 .adb_type = MAC_ADB_II,
594 .via_type = MAC_VIA_QUADRA,
595 .scsi_type = MAC_SCSI_QUADRA,
596 .scc_type = MAC_SCC_QUADRA,
597 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100598 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100599 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700600 }, {
601 .ident = MAC_MODEL_C660,
602 .name = "Centris 660AV",
603 .adb_type = MAC_ADB_CUDA,
604 .via_type = MAC_VIA_QUADRA,
605 .scsi_type = MAC_SCSI_QUADRA3,
606 .scc_type = MAC_SCC_PSC,
607 .ether_type = MAC_ETHER_MACE,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100608 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100609 .floppy_type = MAC_FLOPPY_AV,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700610 },
611
612 /*
613 * The PowerBooks all the same "Combo" custom IC for SCSI and SCC
614 * and a PMU (in two variations?) for ADB. Most of them use the
615 * Quadra-style VIAs. A few models also have IDE from hell.
616 */
617
618 {
619 .ident = MAC_MODEL_PB140,
620 .name = "PowerBook 140",
621 .adb_type = MAC_ADB_PB1,
622 .via_type = MAC_VIA_QUADRA,
623 .scsi_type = MAC_SCSI_OLD,
624 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100625 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100626 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700627 }, {
628 .ident = MAC_MODEL_PB145,
629 .name = "PowerBook 145",
630 .adb_type = MAC_ADB_PB1,
631 .via_type = MAC_VIA_QUADRA,
632 .scsi_type = MAC_SCSI_OLD,
633 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100634 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100635 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700636 }, {
637 .ident = MAC_MODEL_PB150,
638 .name = "PowerBook 150",
639 .adb_type = MAC_ADB_PB1,
640 .via_type = MAC_VIA_IIci,
641 .scsi_type = MAC_SCSI_OLD,
642 .ide_type = MAC_IDE_PB,
643 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100644 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100645 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700646 }, {
647 .ident = MAC_MODEL_PB160,
648 .name = "PowerBook 160",
649 .adb_type = MAC_ADB_PB1,
650 .via_type = MAC_VIA_QUADRA,
651 .scsi_type = MAC_SCSI_OLD,
652 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100653 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100654 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700655 }, {
656 .ident = MAC_MODEL_PB165,
657 .name = "PowerBook 165",
658 .adb_type = MAC_ADB_PB1,
659 .via_type = MAC_VIA_QUADRA,
660 .scsi_type = MAC_SCSI_OLD,
661 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100662 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100663 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700664 }, {
665 .ident = MAC_MODEL_PB165C,
666 .name = "PowerBook 165c",
667 .adb_type = MAC_ADB_PB1,
668 .via_type = MAC_VIA_QUADRA,
669 .scsi_type = MAC_SCSI_OLD,
670 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100671 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100672 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700673 }, {
674 .ident = MAC_MODEL_PB170,
675 .name = "PowerBook 170",
676 .adb_type = MAC_ADB_PB1,
677 .via_type = MAC_VIA_QUADRA,
678 .scsi_type = MAC_SCSI_OLD,
679 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100680 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100681 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700682 }, {
683 .ident = MAC_MODEL_PB180,
684 .name = "PowerBook 180",
685 .adb_type = MAC_ADB_PB1,
686 .via_type = MAC_VIA_QUADRA,
687 .scsi_type = MAC_SCSI_OLD,
688 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100689 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100690 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700691 }, {
692 .ident = MAC_MODEL_PB180C,
693 .name = "PowerBook 180c",
694 .adb_type = MAC_ADB_PB1,
695 .via_type = MAC_VIA_QUADRA,
696 .scsi_type = MAC_SCSI_OLD,
697 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100698 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100699 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700700 }, {
701 .ident = MAC_MODEL_PB190,
702 .name = "PowerBook 190",
703 .adb_type = MAC_ADB_PB2,
704 .via_type = MAC_VIA_QUADRA,
705 .scsi_type = MAC_SCSI_OLD,
706 .ide_type = MAC_IDE_BABOON,
707 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100708 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100709 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700710 }, {
711 .ident = MAC_MODEL_PB520,
712 .name = "PowerBook 520",
713 .adb_type = MAC_ADB_PB2,
714 .via_type = MAC_VIA_QUADRA,
715 .scsi_type = MAC_SCSI_OLD,
716 .scc_type = MAC_SCC_QUADRA,
717 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100718 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100719 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700720 },
721
722 /*
723 * PowerBook Duos are pretty much like normal PowerBooks
724 * All of these probably have onboard SONIC in the Dock which
725 * means we'll have to probe for it eventually.
726 *
Simon Arlott0c79cf62007-10-20 01:20:32 +0200727 * Are these really MAC_VIA_IIci? The developer notes for the
Linus Torvalds1da177e2005-04-16 15:20:36 -0700728 * Duos show pretty much the same custom parts as in most of
729 * the other PowerBooks which would imply MAC_VIA_QUADRA.
730 */
731
732 {
733 .ident = MAC_MODEL_PB210,
734 .name = "PowerBook Duo 210",
735 .adb_type = MAC_ADB_PB2,
736 .via_type = MAC_VIA_IIci,
737 .scsi_type = MAC_SCSI_OLD,
738 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100739 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100740 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700741 }, {
742 .ident = MAC_MODEL_PB230,
743 .name = "PowerBook Duo 230",
744 .adb_type = MAC_ADB_PB2,
745 .via_type = MAC_VIA_IIci,
746 .scsi_type = MAC_SCSI_OLD,
747 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100748 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100749 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700750 }, {
751 .ident = MAC_MODEL_PB250,
752 .name = "PowerBook Duo 250",
753 .adb_type = MAC_ADB_PB2,
754 .via_type = MAC_VIA_IIci,
755 .scsi_type = MAC_SCSI_OLD,
756 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100757 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100758 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700759 }, {
760 .ident = MAC_MODEL_PB270C,
761 .name = "PowerBook Duo 270c",
762 .adb_type = MAC_ADB_PB2,
763 .via_type = MAC_VIA_IIci,
764 .scsi_type = MAC_SCSI_OLD,
765 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100766 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100767 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700768 }, {
769 .ident = MAC_MODEL_PB280,
770 .name = "PowerBook Duo 280",
771 .adb_type = MAC_ADB_PB2,
772 .via_type = MAC_VIA_IIci,
773 .scsi_type = MAC_SCSI_OLD,
774 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100775 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100776 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700777 }, {
778 .ident = MAC_MODEL_PB280C,
779 .name = "PowerBook Duo 280c",
780 .adb_type = MAC_ADB_PB2,
781 .via_type = MAC_VIA_IIci,
782 .scsi_type = MAC_SCSI_OLD,
783 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100784 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100785 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700786 },
787
788 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100789 * Other stuff?
Linus Torvalds1da177e2005-04-16 15:20:36 -0700790 */
Finn Thain53aac0a2009-11-04 00:39:09 +1100791
Linus Torvalds1da177e2005-04-16 15:20:36 -0700792 {
793 .ident = -1
794 }
795};
796
Finn Thain80614e52009-11-17 20:06:48 +1100797static struct resource scc_a_rsrcs[] = {
798 { .flags = IORESOURCE_MEM },
799 { .flags = IORESOURCE_IRQ },
800};
801
802static struct resource scc_b_rsrcs[] = {
803 { .flags = IORESOURCE_MEM },
804 { .flags = IORESOURCE_IRQ },
805};
806
807struct platform_device scc_a_pdev = {
808 .name = "scc",
809 .id = 0,
810 .num_resources = ARRAY_SIZE(scc_a_rsrcs),
811 .resource = scc_a_rsrcs,
812};
813EXPORT_SYMBOL(scc_a_pdev);
814
815struct platform_device scc_b_pdev = {
816 .name = "scc",
817 .id = 1,
818 .num_resources = ARRAY_SIZE(scc_b_rsrcs),
819 .resource = scc_b_rsrcs,
820};
821EXPORT_SYMBOL(scc_b_pdev);
822
Adrian Bunk8dfbdf42008-07-17 21:16:25 +0200823static void __init mac_identify(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700824{
825 struct mac_model *m;
826
827 /* Penguin data useful? */
828 int model = mac_bi_data.id;
829 if (!model) {
830 /* no bootinfo model id -> NetBSD booter was used! */
831 /* XXX FIXME: breaks for model > 31 */
Roman Zippel6ff58012007-05-01 22:32:43 +0200832 model = (mac_bi_data.cpuid >> 2) & 63;
Finn Thain53aac0a2009-11-04 00:39:09 +1100833 printk(KERN_WARNING "No bootinfo model ID, using cpuid instead "
834 "(obsolete bootloader?)\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700835 }
836
837 macintosh_config = mac_data_table;
Roman Zippel6ff58012007-05-01 22:32:43 +0200838 for (m = macintosh_config; m->ident != -1; m++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700839 if (m->ident == model) {
840 macintosh_config = m;
841 break;
842 }
843 }
844
Finn Thain80614e52009-11-17 20:06:48 +1100845 /* Set up serial port resources for the console initcall. */
846
847 scc_a_rsrcs[0].start = (resource_size_t) mac_bi_data.sccbase + 2;
848 scc_a_rsrcs[0].end = scc_a_rsrcs[0].start;
849 scc_b_rsrcs[0].start = (resource_size_t) mac_bi_data.sccbase;
850 scc_b_rsrcs[0].end = scc_b_rsrcs[0].start;
851
852 switch (macintosh_config->scc_type) {
853 case MAC_SCC_PSC:
854 scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC_A;
855 scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC_B;
856 break;
857 default:
858 scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC;
859 scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC;
860 break;
861 }
862
Finn Thain53aac0a2009-11-04 00:39:09 +1100863 /*
864 * We need to pre-init the IOPs, if any. Otherwise
865 * the serial console won't work if the user had
866 * the serial ports set to "Faster" mode in MacOS.
867 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700868 iop_preinit();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700869
Frans Popb9b0d8b2010-02-06 18:47:11 +0100870 printk(KERN_INFO "Detected Macintosh model: %d\n", model);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700871
872 /*
873 * Report booter data:
874 */
Roman Zippel6ff58012007-05-01 22:32:43 +0200875 printk(KERN_DEBUG " Penguin bootinfo data:\n");
Finn Thain53aac0a2009-11-04 00:39:09 +1100876 printk(KERN_DEBUG " Video: addr 0x%lx "
877 "row 0x%lx depth %lx dimensions %ld x %ld\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700878 mac_bi_data.videoaddr, mac_bi_data.videorow,
879 mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF,
880 mac_bi_data.dimensions >> 16);
Frans Popb9b0d8b2010-02-06 18:47:11 +0100881 printk(KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700882 mac_bi_data.videological, mac_orig_videoaddr,
883 mac_bi_data.sccbase);
Frans Popb9b0d8b2010-02-06 18:47:11 +0100884 printk(KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700885 mac_bi_data.boottime, mac_bi_data.gmtbias);
Frans Popb9b0d8b2010-02-06 18:47:11 +0100886 printk(KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700887 mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700888
Linus Torvalds1da177e2005-04-16 15:20:36 -0700889 iop_init();
890 via_init();
891 oss_init();
892 psc_init();
893 baboon_init();
Finn Thain18814ee2009-11-17 20:03:05 +1100894
895#ifdef CONFIG_ADB_CUDA
896 find_via_cuda();
897#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700898}
899
Adrian Bunk8dfbdf42008-07-17 21:16:25 +0200900static void __init mac_report_hardware(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700901{
902 printk(KERN_INFO "Apple Macintosh %s\n", macintosh_config->name);
903}
904
905static void mac_get_model(char *str)
906{
Roman Zippel6ff58012007-05-01 22:32:43 +0200907 strcpy(str, "Macintosh ");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700908 strcat(str, macintosh_config->name);
909}
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100910
Finn Thain2724daf2009-11-04 00:39:56 +1100911static struct resource swim_rsrc = { .flags = IORESOURCE_MEM };
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100912
Finn Thain2724daf2009-11-04 00:39:56 +1100913static struct platform_device swim_pdev = {
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100914 .name = "swim",
915 .id = -1,
Finn Thain2724daf2009-11-04 00:39:56 +1100916 .num_resources = 1,
917 .resource = &swim_rsrc,
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100918};
919
Finn Thaincff75f12009-11-04 00:41:35 +1100920static struct platform_device esp_0_pdev = {
921 .name = "mac_esp",
922 .id = 0,
923};
924
925static struct platform_device esp_1_pdev = {
926 .name = "mac_esp",
927 .id = 1,
928};
929
Finn Thaineeb9c182009-11-04 00:42:02 +1100930static struct platform_device sonic_pdev = {
931 .name = "macsonic",
932 .id = -1,
933};
934
935static struct platform_device mace_pdev = {
936 .name = "macmace",
937 .id = -1,
938};
939
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100940int __init mac_platform_init(void)
941{
942 u8 *swim_base;
943
Finn Thain2724daf2009-11-04 00:39:56 +1100944 /*
Finn Thain80614e52009-11-17 20:06:48 +1100945 * Serial devices
946 */
947
948 platform_device_register(&scc_a_pdev);
949 platform_device_register(&scc_b_pdev);
950
951 /*
Finn Thain2724daf2009-11-04 00:39:56 +1100952 * Floppy device
953 */
954
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100955 switch (macintosh_config->floppy_type) {
956 case MAC_FLOPPY_SWIM_ADDR1:
957 swim_base = (u8 *)(VIA1_BASE + 0x1E000);
958 break;
959 case MAC_FLOPPY_SWIM_ADDR2:
960 swim_base = (u8 *)(VIA1_BASE + 0x16000);
961 break;
962 default:
Finn Thain2724daf2009-11-04 00:39:56 +1100963 swim_base = NULL;
964 break;
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100965 }
966
Finn Thain2724daf2009-11-04 00:39:56 +1100967 if (swim_base) {
968 swim_rsrc.start = (resource_size_t) swim_base,
969 swim_rsrc.end = (resource_size_t) swim_base + 0x2000,
970 platform_device_register(&swim_pdev);
971 }
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100972
Finn Thaincff75f12009-11-04 00:41:35 +1100973 /*
974 * SCSI device(s)
975 */
976
977 switch (macintosh_config->scsi_type) {
978 case MAC_SCSI_QUADRA:
979 case MAC_SCSI_QUADRA3:
980 platform_device_register(&esp_0_pdev);
981 break;
982 case MAC_SCSI_QUADRA2:
983 platform_device_register(&esp_0_pdev);
984 if ((macintosh_config->ident == MAC_MODEL_Q900) ||
985 (macintosh_config->ident == MAC_MODEL_Q950))
986 platform_device_register(&esp_1_pdev);
987 break;
988 }
989
Finn Thaineeb9c182009-11-04 00:42:02 +1100990 /*
991 * Ethernet device
992 */
993
994 switch (macintosh_config->ether_type) {
995 case MAC_ETHER_SONIC:
996 platform_device_register(&sonic_pdev);
997 break;
998 case MAC_ETHER_MACE:
999 platform_device_register(&mace_pdev);
1000 break;
1001 }
1002
Finn Thain2724daf2009-11-04 00:39:56 +11001003 return 0;
Laurent Vivier8852ecd2008-11-15 16:10:10 +01001004}
1005
1006arch_initcall(mac_platform_init);