blob: f60ff5f59205c1f2285f53fd2c1ae08bae9d6d93 [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
Finn Thain93edd022011-10-24 01:11:12 +110074#ifdef CONFIG_EARLY_PRINTK
75asmlinkage void __init mac_early_print(const char *s, unsigned n);
76
77static void __init mac_early_cons_write(struct console *con,
78 const char *s, unsigned n)
79{
80 mac_early_print(s, n);
81}
82
83static struct console __initdata mac_early_cons = {
84 .name = "early",
85 .write = mac_early_cons_write,
86 .flags = CON_PRINTBUFFER | CON_BOOT,
87 .index = -1
88};
89
90int __init mac_unregister_early_cons(void)
91{
92 /* mac_early_print can't be used after init sections are discarded */
93 return unregister_console(&mac_early_cons);
94}
95
96late_initcall(mac_unregister_early_cons);
97#endif
98
Al Viro66a3f822007-07-20 04:33:28 +010099static void __init mac_sched_init(irq_handler_t vector)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700100{
101 via_init_clock(vector);
102}
103
Linus Torvalds1da177e2005-04-16 15:20:36 -0700104/*
105 * Parse a Macintosh-specific record in the bootinfo
106 */
107
108int __init mac_parse_bootinfo(const struct bi_record *record)
109{
Roman Zippel6ff58012007-05-01 22:32:43 +0200110 int unknown = 0;
111 const u_long *data = record->data;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700112
Roman Zippel6ff58012007-05-01 22:32:43 +0200113 switch (record->tag) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700114 case BI_MAC_MODEL:
Roman Zippel6ff58012007-05-01 22:32:43 +0200115 mac_bi_data.id = *data;
116 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700117 case BI_MAC_VADDR:
Roman Zippel6ff58012007-05-01 22:32:43 +0200118 mac_bi_data.videoaddr = *data;
119 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120 case BI_MAC_VDEPTH:
Roman Zippel6ff58012007-05-01 22:32:43 +0200121 mac_bi_data.videodepth = *data;
122 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700123 case BI_MAC_VROW:
Roman Zippel6ff58012007-05-01 22:32:43 +0200124 mac_bi_data.videorow = *data;
125 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700126 case BI_MAC_VDIM:
Roman Zippel6ff58012007-05-01 22:32:43 +0200127 mac_bi_data.dimensions = *data;
128 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700129 case BI_MAC_VLOGICAL:
Roman Zippel6ff58012007-05-01 22:32:43 +0200130 mac_bi_data.videological = VIDEOMEMBASE + (*data & ~VIDEOMEMMASK);
131 mac_orig_videoaddr = *data;
132 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700133 case BI_MAC_SCCBASE:
Roman Zippel6ff58012007-05-01 22:32:43 +0200134 mac_bi_data.sccbase = *data;
135 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700136 case BI_MAC_BTIME:
Roman Zippel6ff58012007-05-01 22:32:43 +0200137 mac_bi_data.boottime = *data;
138 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700139 case BI_MAC_GMTBIAS:
Roman Zippel6ff58012007-05-01 22:32:43 +0200140 mac_bi_data.gmtbias = *data;
141 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700142 case BI_MAC_MEMSIZE:
Roman Zippel6ff58012007-05-01 22:32:43 +0200143 mac_bi_data.memsize = *data;
144 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700145 case BI_MAC_CPUID:
Roman Zippel6ff58012007-05-01 22:32:43 +0200146 mac_bi_data.cpuid = *data;
147 break;
148 case BI_MAC_ROMBASE:
149 mac_bi_data.rombase = *data;
150 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700151 default:
Roman Zippel6ff58012007-05-01 22:32:43 +0200152 unknown = 1;
153 break;
154 }
155 return unknown;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700156}
157
158/*
159 * Flip into 24bit mode for an instant - flushes the L2 cache card. We
160 * have to disable interrupts for this. Our IRQ handlers will crap
161 * themselves if they take an IRQ in 24bit mode!
162 */
163
164static void mac_cache_card_flush(int writeback)
165{
166 unsigned long flags;
Roman Zippel6ff58012007-05-01 22:32:43 +0200167
Linus Torvalds1da177e2005-04-16 15:20:36 -0700168 local_irq_save(flags);
169 via_flush_cache();
170 local_irq_restore(flags);
171}
172
173void __init config_mac(void)
174{
Roman Zippel6ff58012007-05-01 22:32:43 +0200175 if (!MACH_IS_MAC)
Frans Popb9b0d8b2010-02-06 18:47:11 +0100176 printk(KERN_ERR "ERROR: no Mac, but config_mac() called!!\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700177
Roman Zippel6ff58012007-05-01 22:32:43 +0200178 mach_sched_init = mac_sched_init;
179 mach_init_IRQ = mac_init_IRQ;
180 mach_get_model = mac_get_model;
181 mach_gettimeoffset = mac_gettimeoffset;
Roman Zippel6ff58012007-05-01 22:32:43 +0200182 mach_hwclk = mac_hwclk;
Roman Zippel6ff58012007-05-01 22:32:43 +0200183 mach_set_clock_mmss = mac_set_clock_mmss;
184 mach_reset = mac_reset;
185 mach_halt = mac_poweroff;
186 mach_power_off = mac_poweroff;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700187 mach_max_dma_address = 0xffffffff;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700188#if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE)
Roman Zippel6ff58012007-05-01 22:32:43 +0200189 mach_beep = mac_mksound;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700190#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700191
Finn Thain93edd022011-10-24 01:11:12 +1100192#ifdef CONFIG_EARLY_PRINTK
193 register_console(&mac_early_cons);
194#endif
195
Linus Torvalds1da177e2005-04-16 15:20:36 -0700196 /*
197 * Determine hardware present
198 */
199
200 mac_identify();
201 mac_report_hardware();
202
Roman Zippel6ff58012007-05-01 22:32:43 +0200203 /*
204 * AFAIK only the IIci takes a cache card. The IIfx has onboard
205 * cache ... someone needs to figure out how to tell if it's on or
206 * not.
207 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700208
209 if (macintosh_config->ident == MAC_MODEL_IICI
Roman Zippel6ff58012007-05-01 22:32:43 +0200210 || macintosh_config->ident == MAC_MODEL_IIFX)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700211 mach_l2_flush = mac_cache_card_flush;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700212}
213
214
215/*
Finn Thain53aac0a2009-11-04 00:39:09 +1100216 * Macintosh Table: hardcoded model configuration data.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700217 *
Finn Thain53aac0a2009-11-04 00:39:09 +1100218 * Much of this was defined by Alan, based on who knows what docs.
219 * I've added a lot more, and some of that was pure guesswork based
220 * on hardware pages present on the Mac web site. Possibly wildly
221 * inaccurate, so look here if a new Mac model won't run. Example: if
222 * a Mac crashes immediately after the VIA1 registers have been dumped
223 * to the screen, it probably died attempting to read DirB on a RBV.
Finn Thain608e2872011-10-24 01:11:22 +1100224 * Meaning it should have MAC_VIA_IICI here :-)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700225 */
226
227struct mac_model *macintosh_config;
228EXPORT_SYMBOL(macintosh_config);
229
Roman Zippel6ff58012007-05-01 22:32:43 +0200230static struct mac_model mac_data_table[] = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700231 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100232 * We'll pretend to be a Macintosh II, that's pretty safe.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700233 */
234
235 {
236 .ident = MAC_MODEL_II,
237 .name = "Unknown",
238 .adb_type = MAC_ADB_II,
239 .via_type = MAC_VIA_II,
240 .scsi_type = MAC_SCSI_OLD,
241 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100242 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100243 .floppy_type = MAC_FLOPPY_IWM,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700244 },
245
246 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100247 * Original Mac II hardware
Linus Torvalds1da177e2005-04-16 15:20:36 -0700248 */
249
250 {
251 .ident = MAC_MODEL_II,
252 .name = "II",
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_IWM,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700259 }, {
260 .ident = MAC_MODEL_IIX,
261 .name = "IIx",
262 .adb_type = MAC_ADB_II,
263 .via_type = MAC_VIA_II,
264 .scsi_type = MAC_SCSI_OLD,
265 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100266 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100267 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700268 }, {
269 .ident = MAC_MODEL_IICX,
270 .name = "IIcx",
271 .adb_type = MAC_ADB_II,
272 .via_type = MAC_VIA_II,
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_SE30,
279 .name = "SE/30",
280 .adb_type = MAC_ADB_II,
281 .via_type = MAC_VIA_II,
282 .scsi_type = MAC_SCSI_OLD,
283 .scc_type = MAC_SCC_II,
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_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700286 },
287
288 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100289 * Weirdified Mac II hardware - all subtly different. Gee thanks
290 * Apple. All these boxes seem to have VIA2 in a different place to
291 * the Mac II (+1A000 rather than +4000)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700292 * CSA: see http://developer.apple.com/technotes/hw/hw_09.html
293 */
294
295 {
296 .ident = MAC_MODEL_IICI,
297 .name = "IIci",
298 .adb_type = MAC_ADB_II,
Finn Thain608e2872011-10-24 01:11:22 +1100299 .via_type = MAC_VIA_IICI,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700300 .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_IIFX,
306 .name = "IIfx",
307 .adb_type = MAC_ADB_IOP,
Finn Thain608e2872011-10-24 01:11:22 +1100308 .via_type = MAC_VIA_IICI,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700309 .scsi_type = MAC_SCSI_OLD,
310 .scc_type = MAC_SCC_IOP,
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_IOP,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700313 }, {
314 .ident = MAC_MODEL_IISI,
315 .name = "IIsi",
316 .adb_type = MAC_ADB_IISI,
Finn Thain608e2872011-10-24 01:11:22 +1100317 .via_type = MAC_VIA_IICI,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700318 .scsi_type = MAC_SCSI_OLD,
319 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100320 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100321 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700322 }, {
323 .ident = MAC_MODEL_IIVI,
324 .name = "IIvi",
325 .adb_type = MAC_ADB_IISI,
Finn Thain608e2872011-10-24 01:11:22 +1100326 .via_type = MAC_VIA_IICI,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700327 .scsi_type = MAC_SCSI_OLD,
328 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100329 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100330 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700331 }, {
332 .ident = MAC_MODEL_IIVX,
333 .name = "IIvx",
334 .adb_type = MAC_ADB_IISI,
Finn Thain608e2872011-10-24 01:11:22 +1100335 .via_type = MAC_VIA_IICI,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700336 .scsi_type = MAC_SCSI_OLD,
337 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100338 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100339 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700340 },
341
342 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100343 * Classic models (guessing: similar to SE/30? Nope, similar to LC...)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700344 */
345
346 {
347 .ident = MAC_MODEL_CLII,
348 .name = "Classic II",
349 .adb_type = MAC_ADB_IISI,
Finn Thain608e2872011-10-24 01:11:22 +1100350 .via_type = MAC_VIA_IICI,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700351 .scsi_type = MAC_SCSI_OLD,
352 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100353 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100354 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700355 }, {
356 .ident = MAC_MODEL_CCL,
357 .name = "Color Classic",
358 .adb_type = MAC_ADB_CUDA,
Finn Thain608e2872011-10-24 01:11:22 +1100359 .via_type = MAC_VIA_IICI,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700360 .scsi_type = MAC_SCSI_OLD,
361 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100362 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100363 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Finn Thain1b460102010-05-29 03:27:18 +1000364 }, {
365 .ident = MAC_MODEL_CCLII,
366 .name = "Color Classic II",
367 .adb_type = MAC_ADB_CUDA,
Finn Thain608e2872011-10-24 01:11:22 +1100368 .via_type = MAC_VIA_IICI,
Finn Thain1b460102010-05-29 03:27:18 +1000369 .scsi_type = MAC_SCSI_OLD,
370 .scc_type = MAC_SCC_II,
371 .nubus_type = MAC_NUBUS,
372 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100373 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700374
375 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100376 * Some Mac LC machines. Basically the same as the IIci, ADB like IIsi
Linus Torvalds1da177e2005-04-16 15:20:36 -0700377 */
378
379 {
380 .ident = MAC_MODEL_LC,
381 .name = "LC",
382 .adb_type = MAC_ADB_IISI,
Finn Thain608e2872011-10-24 01:11:22 +1100383 .via_type = MAC_VIA_IICI,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700384 .scsi_type = MAC_SCSI_OLD,
385 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100386 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100387 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700388 }, {
389 .ident = MAC_MODEL_LCII,
390 .name = "LC II",
391 .adb_type = MAC_ADB_IISI,
Finn Thain608e2872011-10-24 01:11:22 +1100392 .via_type = MAC_VIA_IICI,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700393 .scsi_type = MAC_SCSI_OLD,
394 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100395 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100396 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700397 }, {
398 .ident = MAC_MODEL_LCIII,
399 .name = "LC III",
400 .adb_type = MAC_ADB_IISI,
Finn Thain608e2872011-10-24 01:11:22 +1100401 .via_type = MAC_VIA_IICI,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700402 .scsi_type = MAC_SCSI_OLD,
403 .scc_type = MAC_SCC_II,
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_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700406 },
407
408 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100409 * Quadra. Video is at 0xF9000000, via is like a MacII. We label it
410 * differently as some of the stuff connected to VIA2 seems different.
411 * Better SCSI chip and onboard ethernet using a NatSemi SONIC except
412 * the 660AV and 840AV which use an AMD 79C940 (MACE).
413 * The 700, 900 and 950 have some I/O chips in the wrong place to
414 * confuse us. The 840AV has a SCSI location of its own (same as
415 * the 660AV).
Linus Torvalds1da177e2005-04-16 15:20:36 -0700416 */
417
418 {
419 .ident = MAC_MODEL_Q605,
420 .name = "Quadra 605",
421 .adb_type = MAC_ADB_CUDA,
422 .via_type = MAC_VIA_QUADRA,
423 .scsi_type = MAC_SCSI_QUADRA,
424 .scc_type = MAC_SCC_QUADRA,
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 }, {
428 .ident = MAC_MODEL_Q605_ACC,
429 .name = "Quadra 605",
430 .adb_type = MAC_ADB_CUDA,
431 .via_type = MAC_VIA_QUADRA,
432 .scsi_type = MAC_SCSI_QUADRA,
433 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100434 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100435 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700436 }, {
437 .ident = MAC_MODEL_Q610,
438 .name = "Quadra 610",
439 .adb_type = MAC_ADB_II,
440 .via_type = MAC_VIA_QUADRA,
441 .scsi_type = MAC_SCSI_QUADRA,
442 .scc_type = MAC_SCC_QUADRA,
443 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100444 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100445 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700446 }, {
447 .ident = MAC_MODEL_Q630,
448 .name = "Quadra 630",
449 .adb_type = MAC_ADB_CUDA,
450 .via_type = MAC_VIA_QUADRA,
451 .scsi_type = MAC_SCSI_QUADRA,
452 .ide_type = MAC_IDE_QUADRA,
453 .scc_type = MAC_SCC_QUADRA,
454 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100455 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100456 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700457 }, {
458 .ident = MAC_MODEL_Q650,
459 .name = "Quadra 650",
460 .adb_type = MAC_ADB_II,
461 .via_type = MAC_VIA_QUADRA,
462 .scsi_type = MAC_SCSI_QUADRA,
463 .scc_type = MAC_SCC_QUADRA,
464 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100465 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100466 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700467 },
Finn Thain53aac0a2009-11-04 00:39:09 +1100468 /* The Q700 does have a NS Sonic */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700469 {
470 .ident = MAC_MODEL_Q700,
471 .name = "Quadra 700",
472 .adb_type = MAC_ADB_II,
473 .via_type = MAC_VIA_QUADRA,
474 .scsi_type = MAC_SCSI_QUADRA2,
475 .scc_type = MAC_SCC_QUADRA,
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_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700479 }, {
480 .ident = MAC_MODEL_Q800,
481 .name = "Quadra 800",
482 .adb_type = MAC_ADB_II,
483 .via_type = MAC_VIA_QUADRA,
484 .scsi_type = MAC_SCSI_QUADRA,
485 .scc_type = MAC_SCC_QUADRA,
486 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100487 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100488 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700489 }, {
490 .ident = MAC_MODEL_Q840,
491 .name = "Quadra 840AV",
492 .adb_type = MAC_ADB_CUDA,
493 .via_type = MAC_VIA_QUADRA,
494 .scsi_type = MAC_SCSI_QUADRA3,
495 .scc_type = MAC_SCC_PSC,
496 .ether_type = MAC_ETHER_MACE,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100497 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100498 .floppy_type = MAC_FLOPPY_AV,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700499 }, {
500 .ident = MAC_MODEL_Q900,
501 .name = "Quadra 900",
502 .adb_type = MAC_ADB_IOP,
503 .via_type = MAC_VIA_QUADRA,
504 .scsi_type = MAC_SCSI_QUADRA2,
505 .scc_type = MAC_SCC_IOP,
506 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100507 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100508 .floppy_type = MAC_FLOPPY_SWIM_IOP,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700509 }, {
510 .ident = MAC_MODEL_Q950,
511 .name = "Quadra 950",
512 .adb_type = MAC_ADB_IOP,
513 .via_type = MAC_VIA_QUADRA,
514 .scsi_type = MAC_SCSI_QUADRA2,
515 .scc_type = MAC_SCC_IOP,
516 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100517 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100518 .floppy_type = MAC_FLOPPY_SWIM_IOP,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700519 },
520
521 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100522 * Performa - more LC type machines
Linus Torvalds1da177e2005-04-16 15:20:36 -0700523 */
524
525 {
526 .ident = MAC_MODEL_P460,
Finn Thain53aac0a2009-11-04 00:39:09 +1100527 .name = "Performa 460",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700528 .adb_type = MAC_ADB_IISI,
Finn Thain608e2872011-10-24 01:11:22 +1100529 .via_type = MAC_VIA_IICI,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700530 .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 }, {
535 .ident = MAC_MODEL_P475,
Finn Thain53aac0a2009-11-04 00:39:09 +1100536 .name = "Performa 475",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700537 .adb_type = MAC_ADB_CUDA,
538 .via_type = MAC_VIA_QUADRA,
539 .scsi_type = MAC_SCSI_QUADRA,
540 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100541 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100542 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700543 }, {
544 .ident = MAC_MODEL_P475F,
Finn Thain53aac0a2009-11-04 00:39:09 +1100545 .name = "Performa 475",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700546 .adb_type = MAC_ADB_CUDA,
547 .via_type = MAC_VIA_QUADRA,
548 .scsi_type = MAC_SCSI_QUADRA,
549 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100550 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100551 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700552 }, {
553 .ident = MAC_MODEL_P520,
Finn Thain53aac0a2009-11-04 00:39:09 +1100554 .name = "Performa 520",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700555 .adb_type = MAC_ADB_CUDA,
Finn Thain608e2872011-10-24 01:11:22 +1100556 .via_type = MAC_VIA_IICI,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700557 .scsi_type = MAC_SCSI_OLD,
558 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100559 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100560 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700561 }, {
562 .ident = MAC_MODEL_P550,
Finn Thain53aac0a2009-11-04 00:39:09 +1100563 .name = "Performa 550",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700564 .adb_type = MAC_ADB_CUDA,
Finn Thain608e2872011-10-24 01:11:22 +1100565 .via_type = MAC_VIA_IICI,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700566 .scsi_type = MAC_SCSI_OLD,
567 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100568 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100569 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700570 },
Finn Thain53aac0a2009-11-04 00:39:09 +1100571 /* These have the comm slot, and therefore possibly SONIC ethernet */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700572 {
573 .ident = MAC_MODEL_P575,
574 .name = "Performa 575",
575 .adb_type = MAC_ADB_CUDA,
576 .via_type = MAC_VIA_QUADRA,
577 .scsi_type = MAC_SCSI_QUADRA,
578 .scc_type = MAC_SCC_II,
579 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100580 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100581 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700582 }, {
583 .ident = MAC_MODEL_P588,
584 .name = "Performa 588",
585 .adb_type = MAC_ADB_CUDA,
586 .via_type = MAC_VIA_QUADRA,
587 .scsi_type = MAC_SCSI_QUADRA,
588 .ide_type = MAC_IDE_QUADRA,
589 .scc_type = MAC_SCC_II,
590 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100591 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100592 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700593 }, {
594 .ident = MAC_MODEL_TV,
595 .name = "TV",
596 .adb_type = MAC_ADB_CUDA,
Finn Thain608e2872011-10-24 01:11:22 +1100597 .via_type = MAC_VIA_IICI,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700598 .scsi_type = MAC_SCSI_OLD,
599 .scc_type = MAC_SCC_II,
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_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700602 }, {
603 .ident = MAC_MODEL_P600,
604 .name = "Performa 600",
605 .adb_type = MAC_ADB_IISI,
Finn Thain608e2872011-10-24 01:11:22 +1100606 .via_type = MAC_VIA_IICI,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700607 .scsi_type = MAC_SCSI_OLD,
608 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100609 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100610 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700611 },
612
613 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100614 * Centris - just guessing again; maybe like Quadra.
615 * The C610 may or may not have SONIC. We probe to make sure.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700616 */
617
Linus Torvalds1da177e2005-04-16 15:20:36 -0700618 {
619 .ident = MAC_MODEL_C610,
620 .name = "Centris 610",
621 .adb_type = MAC_ADB_II,
622 .via_type = MAC_VIA_QUADRA,
623 .scsi_type = MAC_SCSI_QUADRA,
624 .scc_type = MAC_SCC_QUADRA,
625 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100626 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100627 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700628 }, {
629 .ident = MAC_MODEL_C650,
630 .name = "Centris 650",
631 .adb_type = MAC_ADB_II,
632 .via_type = MAC_VIA_QUADRA,
633 .scsi_type = MAC_SCSI_QUADRA,
634 .scc_type = MAC_SCC_QUADRA,
635 .ether_type = MAC_ETHER_SONIC,
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_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700638 }, {
639 .ident = MAC_MODEL_C660,
640 .name = "Centris 660AV",
641 .adb_type = MAC_ADB_CUDA,
642 .via_type = MAC_VIA_QUADRA,
643 .scsi_type = MAC_SCSI_QUADRA3,
644 .scc_type = MAC_SCC_PSC,
645 .ether_type = MAC_ETHER_MACE,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100646 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100647 .floppy_type = MAC_FLOPPY_AV,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700648 },
649
650 /*
651 * The PowerBooks all the same "Combo" custom IC for SCSI and SCC
652 * and a PMU (in two variations?) for ADB. Most of them use the
653 * Quadra-style VIAs. A few models also have IDE from hell.
654 */
655
656 {
657 .ident = MAC_MODEL_PB140,
658 .name = "PowerBook 140",
659 .adb_type = MAC_ADB_PB1,
660 .via_type = MAC_VIA_QUADRA,
661 .scsi_type = MAC_SCSI_OLD,
662 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100663 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100664 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700665 }, {
666 .ident = MAC_MODEL_PB145,
667 .name = "PowerBook 145",
668 .adb_type = MAC_ADB_PB1,
669 .via_type = MAC_VIA_QUADRA,
670 .scsi_type = MAC_SCSI_OLD,
671 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100672 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100673 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700674 }, {
675 .ident = MAC_MODEL_PB150,
676 .name = "PowerBook 150",
Finn Thain4107c452011-10-24 01:11:20 +1100677 .adb_type = MAC_ADB_PB2,
Finn Thain608e2872011-10-24 01:11:22 +1100678 .via_type = MAC_VIA_IICI,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700679 .scsi_type = MAC_SCSI_OLD,
680 .ide_type = MAC_IDE_PB,
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_PB160,
686 .name = "PowerBook 160",
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_PB165,
695 .name = "PowerBook 165",
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_PB165C,
704 .name = "PowerBook 165c",
705 .adb_type = MAC_ADB_PB1,
706 .via_type = MAC_VIA_QUADRA,
707 .scsi_type = MAC_SCSI_OLD,
708 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100709 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100710 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700711 }, {
712 .ident = MAC_MODEL_PB170,
713 .name = "PowerBook 170",
714 .adb_type = MAC_ADB_PB1,
715 .via_type = MAC_VIA_QUADRA,
716 .scsi_type = MAC_SCSI_OLD,
717 .scc_type = MAC_SCC_QUADRA,
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 .ident = MAC_MODEL_PB180,
722 .name = "PowerBook 180",
723 .adb_type = MAC_ADB_PB1,
724 .via_type = MAC_VIA_QUADRA,
725 .scsi_type = MAC_SCSI_OLD,
726 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100727 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100728 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700729 }, {
730 .ident = MAC_MODEL_PB180C,
731 .name = "PowerBook 180c",
732 .adb_type = MAC_ADB_PB1,
733 .via_type = MAC_VIA_QUADRA,
734 .scsi_type = MAC_SCSI_OLD,
735 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100736 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100737 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700738 }, {
739 .ident = MAC_MODEL_PB190,
740 .name = "PowerBook 190",
741 .adb_type = MAC_ADB_PB2,
742 .via_type = MAC_VIA_QUADRA,
743 .scsi_type = MAC_SCSI_OLD,
744 .ide_type = MAC_IDE_BABOON,
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_PB520,
750 .name = "PowerBook 520",
751 .adb_type = MAC_ADB_PB2,
752 .via_type = MAC_VIA_QUADRA,
753 .scsi_type = MAC_SCSI_OLD,
754 .scc_type = MAC_SCC_QUADRA,
755 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100756 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100757 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700758 },
759
760 /*
761 * PowerBook Duos are pretty much like normal PowerBooks
762 * All of these probably have onboard SONIC in the Dock which
763 * means we'll have to probe for it eventually.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700764 */
765
766 {
767 .ident = MAC_MODEL_PB210,
768 .name = "PowerBook Duo 210",
769 .adb_type = MAC_ADB_PB2,
Finn Thain608e2872011-10-24 01:11:22 +1100770 .via_type = MAC_VIA_IICI,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700771 .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_PB230,
777 .name = "PowerBook Duo 230",
778 .adb_type = MAC_ADB_PB2,
Finn Thain608e2872011-10-24 01:11:22 +1100779 .via_type = MAC_VIA_IICI,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700780 .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 .ident = MAC_MODEL_PB250,
786 .name = "PowerBook Duo 250",
787 .adb_type = MAC_ADB_PB2,
Finn Thain608e2872011-10-24 01:11:22 +1100788 .via_type = MAC_VIA_IICI,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700789 .scsi_type = MAC_SCSI_OLD,
790 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100791 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100792 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700793 }, {
794 .ident = MAC_MODEL_PB270C,
795 .name = "PowerBook Duo 270c",
796 .adb_type = MAC_ADB_PB2,
Finn Thain608e2872011-10-24 01:11:22 +1100797 .via_type = MAC_VIA_IICI,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700798 .scsi_type = MAC_SCSI_OLD,
799 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100800 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100801 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700802 }, {
803 .ident = MAC_MODEL_PB280,
804 .name = "PowerBook Duo 280",
805 .adb_type = MAC_ADB_PB2,
Finn Thain608e2872011-10-24 01:11:22 +1100806 .via_type = MAC_VIA_IICI,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700807 .scsi_type = MAC_SCSI_OLD,
808 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100809 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100810 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700811 }, {
812 .ident = MAC_MODEL_PB280C,
813 .name = "PowerBook Duo 280c",
814 .adb_type = MAC_ADB_PB2,
Finn Thain608e2872011-10-24 01:11:22 +1100815 .via_type = MAC_VIA_IICI,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700816 .scsi_type = MAC_SCSI_OLD,
817 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100818 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100819 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700820 },
821
822 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100823 * Other stuff?
Linus Torvalds1da177e2005-04-16 15:20:36 -0700824 */
Finn Thain53aac0a2009-11-04 00:39:09 +1100825
Linus Torvalds1da177e2005-04-16 15:20:36 -0700826 {
827 .ident = -1
828 }
829};
830
Finn Thain80614e52009-11-17 20:06:48 +1100831static struct resource scc_a_rsrcs[] = {
832 { .flags = IORESOURCE_MEM },
833 { .flags = IORESOURCE_IRQ },
834};
835
836static struct resource scc_b_rsrcs[] = {
837 { .flags = IORESOURCE_MEM },
838 { .flags = IORESOURCE_IRQ },
839};
840
841struct platform_device scc_a_pdev = {
842 .name = "scc",
843 .id = 0,
844 .num_resources = ARRAY_SIZE(scc_a_rsrcs),
845 .resource = scc_a_rsrcs,
846};
847EXPORT_SYMBOL(scc_a_pdev);
848
849struct platform_device scc_b_pdev = {
850 .name = "scc",
851 .id = 1,
852 .num_resources = ARRAY_SIZE(scc_b_rsrcs),
853 .resource = scc_b_rsrcs,
854};
855EXPORT_SYMBOL(scc_b_pdev);
856
Adrian Bunk8dfbdf42008-07-17 21:16:25 +0200857static void __init mac_identify(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700858{
859 struct mac_model *m;
860
861 /* Penguin data useful? */
862 int model = mac_bi_data.id;
863 if (!model) {
864 /* no bootinfo model id -> NetBSD booter was used! */
865 /* XXX FIXME: breaks for model > 31 */
Roman Zippel6ff58012007-05-01 22:32:43 +0200866 model = (mac_bi_data.cpuid >> 2) & 63;
Finn Thain53aac0a2009-11-04 00:39:09 +1100867 printk(KERN_WARNING "No bootinfo model ID, using cpuid instead "
868 "(obsolete bootloader?)\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700869 }
870
871 macintosh_config = mac_data_table;
Roman Zippel6ff58012007-05-01 22:32:43 +0200872 for (m = macintosh_config; m->ident != -1; m++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700873 if (m->ident == model) {
874 macintosh_config = m;
875 break;
876 }
877 }
878
Finn Thain80614e52009-11-17 20:06:48 +1100879 /* Set up serial port resources for the console initcall. */
880
881 scc_a_rsrcs[0].start = (resource_size_t) mac_bi_data.sccbase + 2;
882 scc_a_rsrcs[0].end = scc_a_rsrcs[0].start;
883 scc_b_rsrcs[0].start = (resource_size_t) mac_bi_data.sccbase;
884 scc_b_rsrcs[0].end = scc_b_rsrcs[0].start;
885
886 switch (macintosh_config->scc_type) {
887 case MAC_SCC_PSC:
888 scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC_A;
889 scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC_B;
890 break;
891 default:
Finn Thainda3fb3c2011-10-24 01:11:18 +1100892 /* On non-PSC machines, the serial ports share an IRQ. */
893 if (macintosh_config->ident == MAC_MODEL_IIFX) {
894 scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC;
895 scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC;
896 } else {
897 scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_AUTO_4;
898 scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_AUTO_4;
899 }
Finn Thain80614e52009-11-17 20:06:48 +1100900 break;
901 }
902
Finn Thain53aac0a2009-11-04 00:39:09 +1100903 /*
904 * We need to pre-init the IOPs, if any. Otherwise
905 * the serial console won't work if the user had
906 * the serial ports set to "Faster" mode in MacOS.
907 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700908 iop_preinit();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700909
Frans Popb9b0d8b2010-02-06 18:47:11 +0100910 printk(KERN_INFO "Detected Macintosh model: %d\n", model);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700911
912 /*
913 * Report booter data:
914 */
Roman Zippel6ff58012007-05-01 22:32:43 +0200915 printk(KERN_DEBUG " Penguin bootinfo data:\n");
Finn Thain53aac0a2009-11-04 00:39:09 +1100916 printk(KERN_DEBUG " Video: addr 0x%lx "
917 "row 0x%lx depth %lx dimensions %ld x %ld\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700918 mac_bi_data.videoaddr, mac_bi_data.videorow,
919 mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF,
920 mac_bi_data.dimensions >> 16);
Frans Popb9b0d8b2010-02-06 18:47:11 +0100921 printk(KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700922 mac_bi_data.videological, mac_orig_videoaddr,
923 mac_bi_data.sccbase);
Frans Popb9b0d8b2010-02-06 18:47:11 +0100924 printk(KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700925 mac_bi_data.boottime, mac_bi_data.gmtbias);
Frans Popb9b0d8b2010-02-06 18:47:11 +0100926 printk(KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700927 mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700928
Linus Torvalds1da177e2005-04-16 15:20:36 -0700929 iop_init();
930 via_init();
931 oss_init();
932 psc_init();
933 baboon_init();
Finn Thain18814ee2009-11-17 20:03:05 +1100934
935#ifdef CONFIG_ADB_CUDA
936 find_via_cuda();
937#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700938}
939
Adrian Bunk8dfbdf42008-07-17 21:16:25 +0200940static void __init mac_report_hardware(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700941{
942 printk(KERN_INFO "Apple Macintosh %s\n", macintosh_config->name);
943}
944
945static void mac_get_model(char *str)
946{
Roman Zippel6ff58012007-05-01 22:32:43 +0200947 strcpy(str, "Macintosh ");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700948 strcat(str, macintosh_config->name);
949}
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100950
Finn Thain2724daf2009-11-04 00:39:56 +1100951static struct resource swim_rsrc = { .flags = IORESOURCE_MEM };
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100952
Finn Thain2724daf2009-11-04 00:39:56 +1100953static struct platform_device swim_pdev = {
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100954 .name = "swim",
955 .id = -1,
Finn Thain2724daf2009-11-04 00:39:56 +1100956 .num_resources = 1,
957 .resource = &swim_rsrc,
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100958};
959
Finn Thaincff75f12009-11-04 00:41:35 +1100960static struct platform_device esp_0_pdev = {
961 .name = "mac_esp",
962 .id = 0,
963};
964
965static struct platform_device esp_1_pdev = {
966 .name = "mac_esp",
967 .id = 1,
968};
969
Finn Thaineeb9c182009-11-04 00:42:02 +1100970static struct platform_device sonic_pdev = {
971 .name = "macsonic",
972 .id = -1,
973};
974
975static struct platform_device mace_pdev = {
976 .name = "macmace",
977 .id = -1,
978};
979
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100980int __init mac_platform_init(void)
981{
982 u8 *swim_base;
983
Finn Thain2724daf2009-11-04 00:39:56 +1100984 /*
Finn Thain80614e52009-11-17 20:06:48 +1100985 * Serial devices
986 */
987
988 platform_device_register(&scc_a_pdev);
989 platform_device_register(&scc_b_pdev);
990
991 /*
Finn Thain2724daf2009-11-04 00:39:56 +1100992 * Floppy device
993 */
994
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100995 switch (macintosh_config->floppy_type) {
996 case MAC_FLOPPY_SWIM_ADDR1:
997 swim_base = (u8 *)(VIA1_BASE + 0x1E000);
998 break;
999 case MAC_FLOPPY_SWIM_ADDR2:
1000 swim_base = (u8 *)(VIA1_BASE + 0x16000);
1001 break;
1002 default:
Finn Thain2724daf2009-11-04 00:39:56 +11001003 swim_base = NULL;
1004 break;
Laurent Vivier8852ecd2008-11-15 16:10:10 +01001005 }
1006
Finn Thain2724daf2009-11-04 00:39:56 +11001007 if (swim_base) {
1008 swim_rsrc.start = (resource_size_t) swim_base,
1009 swim_rsrc.end = (resource_size_t) swim_base + 0x2000,
1010 platform_device_register(&swim_pdev);
1011 }
Laurent Vivier8852ecd2008-11-15 16:10:10 +01001012
Finn Thaincff75f12009-11-04 00:41:35 +11001013 /*
1014 * SCSI device(s)
1015 */
1016
1017 switch (macintosh_config->scsi_type) {
1018 case MAC_SCSI_QUADRA:
1019 case MAC_SCSI_QUADRA3:
1020 platform_device_register(&esp_0_pdev);
1021 break;
1022 case MAC_SCSI_QUADRA2:
1023 platform_device_register(&esp_0_pdev);
1024 if ((macintosh_config->ident == MAC_MODEL_Q900) ||
1025 (macintosh_config->ident == MAC_MODEL_Q950))
1026 platform_device_register(&esp_1_pdev);
1027 break;
1028 }
1029
Finn Thaineeb9c182009-11-04 00:42:02 +11001030 /*
1031 * Ethernet device
1032 */
1033
1034 switch (macintosh_config->ether_type) {
1035 case MAC_ETHER_SONIC:
1036 platform_device_register(&sonic_pdev);
1037 break;
1038 case MAC_ETHER_MACE:
1039 platform_device_register(&mace_pdev);
1040 break;
1041 }
1042
Finn Thain2724daf2009-11-04 00:39:56 +11001043 return 0;
Laurent Vivier8852ecd2008-11-15 16:10:10 +01001044}
1045
1046arch_initcall(mac_platform_init);