blob: 2f33a33001e56a0ae048fc791d012db7d18d9b7c [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
Arnd Bergmann084b3602016-05-30 20:57:59 +020013#include <linux/errno.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070014#include <linux/module.h>
15#include <linux/types.h>
16#include <linux/mm.h>
17#include <linux/tty.h>
18#include <linux/console.h>
19#include <linux/interrupt.h>
20/* keyb */
21#include <linux/random.h>
22#include <linux/delay.h>
23/* keyb */
24#include <linux/init.h>
25#include <linux/vt_kern.h>
Laurent Vivier8852ecd2008-11-15 16:10:10 +010026#include <linux/platform_device.h>
Finn Thain18814ee2009-11-17 20:03:05 +110027#include <linux/adb.h>
28#include <linux/cuda.h>
Arnd Bergmann084b3602016-05-30 20:57:59 +020029#include <linux/rtc.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070030
Linus Torvalds1da177e2005-04-16 15:20:36 -070031#include <asm/setup.h>
32#include <asm/bootinfo.h>
Geert Uytterhoeven4c3c5222013-10-02 11:37:33 +020033#include <asm/bootinfo-mac.h>
Geert Uytterhoevenabe48102013-10-04 11:41:24 +020034#include <asm/byteorder.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070035
Linus Torvalds1da177e2005-04-16 15:20:36 -070036#include <asm/io.h>
37#include <asm/irq.h>
38#include <asm/pgtable.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070039#include <asm/machdep.h>
40
41#include <asm/macintosh.h>
42#include <asm/macints.h>
43#include <asm/machw.h>
44
45#include <asm/mac_iop.h>
46#include <asm/mac_via.h>
47#include <asm/mac_oss.h>
48#include <asm/mac_psc.h>
49
50/* Mac bootinfo struct */
Linus Torvalds1da177e2005-04-16 15:20:36 -070051struct mac_booter_data mac_bi_data;
Linus Torvalds1da177e2005-04-16 15:20:36 -070052
Linus Torvalds1da177e2005-04-16 15:20:36 -070053/* The phys. video addr. - might be bogus on some machines */
Adrian Bunk8dfbdf42008-07-17 21:16:25 +020054static unsigned long mac_orig_videoaddr;
Linus Torvalds1da177e2005-04-16 15:20:36 -070055
56/* Mac specific timer functions */
Stephen Warrenc8d5ba12012-11-08 11:34:55 -070057extern u32 mac_gettimeoffset(void);
Roman Zippel6ff58012007-05-01 22:32:43 +020058extern int mac_hwclk(int, struct rtc_time *);
59extern int mac_set_clock_mmss(unsigned long);
Linus Torvalds1da177e2005-04-16 15:20:36 -070060extern void iop_preinit(void);
61extern void iop_init(void);
62extern void via_init(void);
David Howells40220c12006-10-09 12:19:47 +010063extern void via_init_clock(irq_handler_t func);
Linus Torvalds1da177e2005-04-16 15:20:36 -070064extern void via_flush_cache(void);
65extern void oss_init(void);
66extern void psc_init(void);
67extern void baboon_init(void);
68
69extern void mac_mksound(unsigned int, unsigned int);
70
Linus Torvalds1da177e2005-04-16 15:20:36 -070071static void mac_get_model(char *str);
Adrian Bunk8dfbdf42008-07-17 21:16:25 +020072static void mac_identify(void);
73static void mac_report_hardware(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070074
Al Viro66a3f822007-07-20 04:33:28 +010075static void __init mac_sched_init(irq_handler_t vector)
Linus Torvalds1da177e2005-04-16 15:20:36 -070076{
77 via_init_clock(vector);
78}
79
Linus Torvalds1da177e2005-04-16 15:20:36 -070080/*
81 * Parse a Macintosh-specific record in the bootinfo
82 */
83
84int __init mac_parse_bootinfo(const struct bi_record *record)
85{
Roman Zippel6ff58012007-05-01 22:32:43 +020086 int unknown = 0;
Geert Uytterhoevenabe48102013-10-04 11:41:24 +020087 const void *data = record->data;
Linus Torvalds1da177e2005-04-16 15:20:36 -070088
Geert Uytterhoevenabe48102013-10-04 11:41:24 +020089 switch (be16_to_cpu(record->tag)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -070090 case BI_MAC_MODEL:
Geert Uytterhoevenabe48102013-10-04 11:41:24 +020091 mac_bi_data.id = be32_to_cpup(data);
Roman Zippel6ff58012007-05-01 22:32:43 +020092 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -070093 case BI_MAC_VADDR:
Geert Uytterhoevenabe48102013-10-04 11:41:24 +020094 mac_bi_data.videoaddr = be32_to_cpup(data);
Roman Zippel6ff58012007-05-01 22:32:43 +020095 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -070096 case BI_MAC_VDEPTH:
Geert Uytterhoevenabe48102013-10-04 11:41:24 +020097 mac_bi_data.videodepth = be32_to_cpup(data);
Roman Zippel6ff58012007-05-01 22:32:43 +020098 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -070099 case BI_MAC_VROW:
Geert Uytterhoevenabe48102013-10-04 11:41:24 +0200100 mac_bi_data.videorow = be32_to_cpup(data);
Roman Zippel6ff58012007-05-01 22:32:43 +0200101 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700102 case BI_MAC_VDIM:
Geert Uytterhoevenabe48102013-10-04 11:41:24 +0200103 mac_bi_data.dimensions = be32_to_cpup(data);
Roman Zippel6ff58012007-05-01 22:32:43 +0200104 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700105 case BI_MAC_VLOGICAL:
Geert Uytterhoevenabe48102013-10-04 11:41:24 +0200106 mac_orig_videoaddr = be32_to_cpup(data);
107 mac_bi_data.videological =
108 VIDEOMEMBASE + (mac_orig_videoaddr & ~VIDEOMEMMASK);
Roman Zippel6ff58012007-05-01 22:32:43 +0200109 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700110 case BI_MAC_SCCBASE:
Geert Uytterhoevenabe48102013-10-04 11:41:24 +0200111 mac_bi_data.sccbase = be32_to_cpup(data);
Roman Zippel6ff58012007-05-01 22:32:43 +0200112 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700113 case BI_MAC_BTIME:
Geert Uytterhoevenabe48102013-10-04 11:41:24 +0200114 mac_bi_data.boottime = be32_to_cpup(data);
Roman Zippel6ff58012007-05-01 22:32:43 +0200115 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700116 case BI_MAC_GMTBIAS:
Geert Uytterhoevenabe48102013-10-04 11:41:24 +0200117 mac_bi_data.gmtbias = be32_to_cpup(data);
Roman Zippel6ff58012007-05-01 22:32:43 +0200118 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700119 case BI_MAC_MEMSIZE:
Geert Uytterhoevenabe48102013-10-04 11:41:24 +0200120 mac_bi_data.memsize = be32_to_cpup(data);
Roman Zippel6ff58012007-05-01 22:32:43 +0200121 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700122 case BI_MAC_CPUID:
Geert Uytterhoevenabe48102013-10-04 11:41:24 +0200123 mac_bi_data.cpuid = be32_to_cpup(data);
Roman Zippel6ff58012007-05-01 22:32:43 +0200124 break;
125 case BI_MAC_ROMBASE:
Geert Uytterhoevenabe48102013-10-04 11:41:24 +0200126 mac_bi_data.rombase = be32_to_cpup(data);
Roman Zippel6ff58012007-05-01 22:32:43 +0200127 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)
Frans Popb9b0d8b2010-02-06 18:47:11 +0100153 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;
Stephen Warrenc8d5ba12012-11-08 11:34:55 -0700158 arch_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.
Finn Thain608e2872011-10-24 01:11:22 +1100197 * 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,
Finn Thain608e2872011-10-24 01:11:22 +1100272 .via_type = MAC_VIA_IICI,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700273 .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,
Finn Thain608e2872011-10-24 01:11:22 +1100281 .via_type = MAC_VIA_IICI,
Finn Thaincbad48d2014-11-12 16:12:07 +1100282 .scsi_type = MAC_SCSI_IIFX,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700283 .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,
Finn Thain608e2872011-10-24 01:11:22 +1100290 .via_type = MAC_VIA_IICI,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700291 .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,
Finn Thain608e2872011-10-24 01:11:22 +1100299 .via_type = MAC_VIA_IICI,
Finn Thain2e874d12015-01-07 11:17:35 +1100300 .scsi_type = MAC_SCSI_LC,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700301 .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,
Finn Thain608e2872011-10-24 01:11:22 +1100308 .via_type = MAC_VIA_IICI,
Finn Thain2e874d12015-01-07 11:17:35 +1100309 .scsi_type = MAC_SCSI_LC,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700310 .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,
Finn Thain608e2872011-10-24 01:11:22 +1100323 .via_type = MAC_VIA_IICI,
Finn Thain2e874d12015-01-07 11:17:35 +1100324 .scsi_type = MAC_SCSI_LC,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700325 .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,
Finn Thain608e2872011-10-24 01:11:22 +1100332 .via_type = MAC_VIA_IICI,
Finn Thain2e874d12015-01-07 11:17:35 +1100333 .scsi_type = MAC_SCSI_LC,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700334 .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,
Finn Thain1b460102010-05-29 03:27:18 +1000337 }, {
338 .ident = MAC_MODEL_CCLII,
339 .name = "Color Classic II",
340 .adb_type = MAC_ADB_CUDA,
Finn Thain608e2872011-10-24 01:11:22 +1100341 .via_type = MAC_VIA_IICI,
Finn Thain2e874d12015-01-07 11:17:35 +1100342 .scsi_type = MAC_SCSI_LC,
Finn Thain1b460102010-05-29 03:27:18 +1000343 .scc_type = MAC_SCC_II,
344 .nubus_type = MAC_NUBUS,
345 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100346 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700347
348 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100349 * Some Mac LC machines. Basically the same as the IIci, ADB like IIsi
Linus Torvalds1da177e2005-04-16 15:20:36 -0700350 */
351
352 {
353 .ident = MAC_MODEL_LC,
354 .name = "LC",
355 .adb_type = MAC_ADB_IISI,
Finn Thain608e2872011-10-24 01:11:22 +1100356 .via_type = MAC_VIA_IICI,
Finn Thain2e874d12015-01-07 11:17:35 +1100357 .scsi_type = MAC_SCSI_LC,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700358 .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_LCII,
363 .name = "LC II",
364 .adb_type = MAC_ADB_IISI,
Finn Thain608e2872011-10-24 01:11:22 +1100365 .via_type = MAC_VIA_IICI,
Finn Thain2e874d12015-01-07 11:17:35 +1100366 .scsi_type = MAC_SCSI_LC,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700367 .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 .ident = MAC_MODEL_LCIII,
372 .name = "LC III",
373 .adb_type = MAC_ADB_IISI,
Finn Thain608e2872011-10-24 01:11:22 +1100374 .via_type = MAC_VIA_IICI,
Finn Thain2e874d12015-01-07 11:17:35 +1100375 .scsi_type = MAC_SCSI_LC,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700376 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100377 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100378 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700379 },
380
381 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100382 * Quadra. Video is at 0xF9000000, via is like a MacII. We label it
383 * differently as some of the stuff connected to VIA2 seems different.
384 * Better SCSI chip and onboard ethernet using a NatSemi SONIC except
385 * the 660AV and 840AV which use an AMD 79C940 (MACE).
386 * The 700, 900 and 950 have some I/O chips in the wrong place to
387 * confuse us. The 840AV has a SCSI location of its own (same as
388 * the 660AV).
Linus Torvalds1da177e2005-04-16 15:20:36 -0700389 */
390
391 {
392 .ident = MAC_MODEL_Q605,
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_Q605_ACC,
402 .name = "Quadra 605",
403 .adb_type = MAC_ADB_CUDA,
404 .via_type = MAC_VIA_QUADRA,
405 .scsi_type = MAC_SCSI_QUADRA,
406 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100407 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100408 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700409 }, {
410 .ident = MAC_MODEL_Q610,
411 .name = "Quadra 610",
412 .adb_type = MAC_ADB_II,
413 .via_type = MAC_VIA_QUADRA,
414 .scsi_type = MAC_SCSI_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_Q630,
421 .name = "Quadra 630",
422 .adb_type = MAC_ADB_CUDA,
423 .via_type = MAC_VIA_QUADRA,
424 .scsi_type = MAC_SCSI_QUADRA,
425 .ide_type = MAC_IDE_QUADRA,
426 .scc_type = MAC_SCC_QUADRA,
427 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100428 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100429 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700430 }, {
431 .ident = MAC_MODEL_Q650,
432 .name = "Quadra 650",
433 .adb_type = MAC_ADB_II,
434 .via_type = MAC_VIA_QUADRA,
435 .scsi_type = MAC_SCSI_QUADRA,
436 .scc_type = MAC_SCC_QUADRA,
437 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100438 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100439 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700440 },
Finn Thain53aac0a2009-11-04 00:39:09 +1100441 /* The Q700 does have a NS Sonic */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700442 {
443 .ident = MAC_MODEL_Q700,
444 .name = "Quadra 700",
445 .adb_type = MAC_ADB_II,
446 .via_type = MAC_VIA_QUADRA,
447 .scsi_type = MAC_SCSI_QUADRA2,
448 .scc_type = MAC_SCC_QUADRA,
449 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100450 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100451 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700452 }, {
453 .ident = MAC_MODEL_Q800,
454 .name = "Quadra 800",
455 .adb_type = MAC_ADB_II,
456 .via_type = MAC_VIA_QUADRA,
457 .scsi_type = MAC_SCSI_QUADRA,
458 .scc_type = MAC_SCC_QUADRA,
459 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100460 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100461 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700462 }, {
463 .ident = MAC_MODEL_Q840,
464 .name = "Quadra 840AV",
465 .adb_type = MAC_ADB_CUDA,
466 .via_type = MAC_VIA_QUADRA,
467 .scsi_type = MAC_SCSI_QUADRA3,
468 .scc_type = MAC_SCC_PSC,
469 .ether_type = MAC_ETHER_MACE,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100470 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100471 .floppy_type = MAC_FLOPPY_AV,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700472 }, {
473 .ident = MAC_MODEL_Q900,
474 .name = "Quadra 900",
475 .adb_type = MAC_ADB_IOP,
476 .via_type = MAC_VIA_QUADRA,
477 .scsi_type = MAC_SCSI_QUADRA2,
478 .scc_type = MAC_SCC_IOP,
479 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100480 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100481 .floppy_type = MAC_FLOPPY_SWIM_IOP,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700482 }, {
483 .ident = MAC_MODEL_Q950,
484 .name = "Quadra 950",
485 .adb_type = MAC_ADB_IOP,
486 .via_type = MAC_VIA_QUADRA,
487 .scsi_type = MAC_SCSI_QUADRA2,
488 .scc_type = MAC_SCC_IOP,
489 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100490 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100491 .floppy_type = MAC_FLOPPY_SWIM_IOP,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700492 },
493
494 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100495 * Performa - more LC type machines
Linus Torvalds1da177e2005-04-16 15:20:36 -0700496 */
497
498 {
499 .ident = MAC_MODEL_P460,
Finn Thain53aac0a2009-11-04 00:39:09 +1100500 .name = "Performa 460",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700501 .adb_type = MAC_ADB_IISI,
Finn Thain608e2872011-10-24 01:11:22 +1100502 .via_type = MAC_VIA_IICI,
Finn Thain2e874d12015-01-07 11:17:35 +1100503 .scsi_type = MAC_SCSI_LC,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700504 .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_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700507 }, {
508 .ident = MAC_MODEL_P475,
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_P475F,
Finn Thain53aac0a2009-11-04 00:39:09 +1100518 .name = "Performa 475",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700519 .adb_type = MAC_ADB_CUDA,
520 .via_type = MAC_VIA_QUADRA,
521 .scsi_type = MAC_SCSI_QUADRA,
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_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700525 }, {
526 .ident = MAC_MODEL_P520,
Finn Thain53aac0a2009-11-04 00:39:09 +1100527 .name = "Performa 520",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700528 .adb_type = MAC_ADB_CUDA,
Finn Thain608e2872011-10-24 01:11:22 +1100529 .via_type = MAC_VIA_IICI,
Finn Thain2e874d12015-01-07 11:17:35 +1100530 .scsi_type = MAC_SCSI_LC,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700531 .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_P550,
Finn Thain53aac0a2009-11-04 00:39:09 +1100536 .name = "Performa 550",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700537 .adb_type = MAC_ADB_CUDA,
Finn Thain608e2872011-10-24 01:11:22 +1100538 .via_type = MAC_VIA_IICI,
Finn Thain2e874d12015-01-07 11:17:35 +1100539 .scsi_type = MAC_SCSI_LC,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700540 .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_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700543 },
Finn Thain53aac0a2009-11-04 00:39:09 +1100544 /* These have the comm slot, and therefore possibly SONIC ethernet */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700545 {
546 .ident = MAC_MODEL_P575,
547 .name = "Performa 575",
548 .adb_type = MAC_ADB_CUDA,
549 .via_type = MAC_VIA_QUADRA,
550 .scsi_type = MAC_SCSI_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_P588,
557 .name = "Performa 588",
558 .adb_type = MAC_ADB_CUDA,
559 .via_type = MAC_VIA_QUADRA,
560 .scsi_type = MAC_SCSI_QUADRA,
561 .ide_type = MAC_IDE_QUADRA,
562 .scc_type = MAC_SCC_II,
563 .ether_type = MAC_ETHER_SONIC,
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_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700566 }, {
567 .ident = MAC_MODEL_TV,
568 .name = "TV",
569 .adb_type = MAC_ADB_CUDA,
Finn Thain608e2872011-10-24 01:11:22 +1100570 .via_type = MAC_VIA_IICI,
Finn Thain2e874d12015-01-07 11:17:35 +1100571 .scsi_type = MAC_SCSI_LC,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700572 .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 .ident = MAC_MODEL_P600,
577 .name = "Performa 600",
578 .adb_type = MAC_ADB_IISI,
Finn Thain608e2872011-10-24 01:11:22 +1100579 .via_type = MAC_VIA_IICI,
Finn Thain2e874d12015-01-07 11:17:35 +1100580 .scsi_type = MAC_SCSI_LC,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700581 .scc_type = MAC_SCC_II,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100582 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100583 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700584 },
585
586 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100587 * Centris - just guessing again; maybe like Quadra.
588 * The C610 may or may not have SONIC. We probe to make sure.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700589 */
590
Linus Torvalds1da177e2005-04-16 15:20:36 -0700591 {
592 .ident = MAC_MODEL_C610,
593 .name = "Centris 610",
594 .adb_type = MAC_ADB_II,
595 .via_type = MAC_VIA_QUADRA,
596 .scsi_type = MAC_SCSI_QUADRA,
597 .scc_type = MAC_SCC_QUADRA,
598 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100599 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100600 .floppy_type = MAC_FLOPPY_SWIM_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700601 }, {
602 .ident = MAC_MODEL_C650,
603 .name = "Centris 650",
604 .adb_type = MAC_ADB_II,
605 .via_type = MAC_VIA_QUADRA,
606 .scsi_type = MAC_SCSI_QUADRA,
607 .scc_type = MAC_SCC_QUADRA,
608 .ether_type = MAC_ETHER_SONIC,
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_ADDR1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700611 }, {
612 .ident = MAC_MODEL_C660,
613 .name = "Centris 660AV",
614 .adb_type = MAC_ADB_CUDA,
615 .via_type = MAC_VIA_QUADRA,
616 .scsi_type = MAC_SCSI_QUADRA3,
617 .scc_type = MAC_SCC_PSC,
618 .ether_type = MAC_ETHER_MACE,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100619 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100620 .floppy_type = MAC_FLOPPY_AV,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700621 },
622
623 /*
624 * The PowerBooks all the same "Combo" custom IC for SCSI and SCC
625 * and a PMU (in two variations?) for ADB. Most of them use the
626 * Quadra-style VIAs. A few models also have IDE from hell.
627 */
628
629 {
630 .ident = MAC_MODEL_PB140,
631 .name = "PowerBook 140",
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_PB145,
640 .name = "PowerBook 145",
641 .adb_type = MAC_ADB_PB1,
642 .via_type = MAC_VIA_QUADRA,
643 .scsi_type = MAC_SCSI_OLD,
644 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100645 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100646 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700647 }, {
648 .ident = MAC_MODEL_PB150,
649 .name = "PowerBook 150",
Finn Thain4107c452011-10-24 01:11:20 +1100650 .adb_type = MAC_ADB_PB2,
Finn Thain608e2872011-10-24 01:11:22 +1100651 .via_type = MAC_VIA_IICI,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700652 .scsi_type = MAC_SCSI_OLD,
653 .ide_type = MAC_IDE_PB,
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_PB160,
659 .name = "PowerBook 160",
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_PB165,
668 .name = "PowerBook 165",
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_PB165C,
677 .name = "PowerBook 165c",
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_PB170,
686 .name = "PowerBook 170",
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_PB180,
695 .name = "PowerBook 180",
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_PB180C,
704 .name = "PowerBook 180c",
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_PB190,
713 .name = "PowerBook 190",
714 .adb_type = MAC_ADB_PB2,
715 .via_type = MAC_VIA_QUADRA,
Finn Thaincbad48d2014-11-12 16:12:07 +1100716 .scsi_type = MAC_SCSI_LATE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700717 .ide_type = MAC_IDE_BABOON,
718 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100719 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100720 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700721 }, {
722 .ident = MAC_MODEL_PB520,
723 .name = "PowerBook 520",
724 .adb_type = MAC_ADB_PB2,
725 .via_type = MAC_VIA_QUADRA,
Finn Thaincbad48d2014-11-12 16:12:07 +1100726 .scsi_type = MAC_SCSI_LATE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700727 .scc_type = MAC_SCC_QUADRA,
728 .ether_type = MAC_ETHER_SONIC,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100729 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100730 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700731 },
732
733 /*
734 * PowerBook Duos are pretty much like normal PowerBooks
735 * All of these probably have onboard SONIC in the Dock which
736 * means we'll have to probe for it eventually.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700737 */
738
739 {
740 .ident = MAC_MODEL_PB210,
741 .name = "PowerBook Duo 210",
742 .adb_type = MAC_ADB_PB2,
Finn Thain608e2872011-10-24 01:11:22 +1100743 .via_type = MAC_VIA_IICI,
Finn Thaincbad48d2014-11-12 16:12:07 +1100744 .scsi_type = MAC_SCSI_DUO,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700745 .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_PB230,
750 .name = "PowerBook Duo 230",
751 .adb_type = MAC_ADB_PB2,
Finn Thain608e2872011-10-24 01:11:22 +1100752 .via_type = MAC_VIA_IICI,
Finn Thaincbad48d2014-11-12 16:12:07 +1100753 .scsi_type = MAC_SCSI_DUO,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700754 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100755 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100756 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700757 }, {
758 .ident = MAC_MODEL_PB250,
759 .name = "PowerBook Duo 250",
760 .adb_type = MAC_ADB_PB2,
Finn Thain608e2872011-10-24 01:11:22 +1100761 .via_type = MAC_VIA_IICI,
Finn Thaincbad48d2014-11-12 16:12:07 +1100762 .scsi_type = MAC_SCSI_DUO,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700763 .scc_type = MAC_SCC_QUADRA,
Laurent Vivier7ad93b42008-11-06 20:57:41 +0100764 .nubus_type = MAC_NUBUS,
Finn Thain53aac0a2009-11-04 00:39:09 +1100765 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700766 }, {
767 .ident = MAC_MODEL_PB270C,
768 .name = "PowerBook Duo 270c",
769 .adb_type = MAC_ADB_PB2,
Finn Thain608e2872011-10-24 01:11:22 +1100770 .via_type = MAC_VIA_IICI,
Finn Thaincbad48d2014-11-12 16:12:07 +1100771 .scsi_type = MAC_SCSI_DUO,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700772 .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_PB280,
777 .name = "PowerBook Duo 280",
778 .adb_type = MAC_ADB_PB2,
Finn Thain608e2872011-10-24 01:11:22 +1100779 .via_type = MAC_VIA_IICI,
Finn Thaincbad48d2014-11-12 16:12:07 +1100780 .scsi_type = MAC_SCSI_DUO,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700781 .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_PB280C,
786 .name = "PowerBook Duo 280c",
787 .adb_type = MAC_ADB_PB2,
Finn Thain608e2872011-10-24 01:11:22 +1100788 .via_type = MAC_VIA_IICI,
Finn Thaincbad48d2014-11-12 16:12:07 +1100789 .scsi_type = MAC_SCSI_DUO,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700790 .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
795 /*
Finn Thain53aac0a2009-11-04 00:39:09 +1100796 * Other stuff?
Linus Torvalds1da177e2005-04-16 15:20:36 -0700797 */
Finn Thain53aac0a2009-11-04 00:39:09 +1100798
Linus Torvalds1da177e2005-04-16 15:20:36 -0700799 {
800 .ident = -1
801 }
802};
803
Finn Thain80614e52009-11-17 20:06:48 +1100804static struct resource scc_a_rsrcs[] = {
805 { .flags = IORESOURCE_MEM },
806 { .flags = IORESOURCE_IRQ },
807};
808
809static struct resource scc_b_rsrcs[] = {
810 { .flags = IORESOURCE_MEM },
811 { .flags = IORESOURCE_IRQ },
812};
813
814struct platform_device scc_a_pdev = {
815 .name = "scc",
816 .id = 0,
817 .num_resources = ARRAY_SIZE(scc_a_rsrcs),
818 .resource = scc_a_rsrcs,
819};
820EXPORT_SYMBOL(scc_a_pdev);
821
822struct platform_device scc_b_pdev = {
823 .name = "scc",
824 .id = 1,
825 .num_resources = ARRAY_SIZE(scc_b_rsrcs),
826 .resource = scc_b_rsrcs,
827};
828EXPORT_SYMBOL(scc_b_pdev);
829
Adrian Bunk8dfbdf42008-07-17 21:16:25 +0200830static void __init mac_identify(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700831{
832 struct mac_model *m;
833
834 /* Penguin data useful? */
835 int model = mac_bi_data.id;
836 if (!model) {
837 /* no bootinfo model id -> NetBSD booter was used! */
838 /* XXX FIXME: breaks for model > 31 */
Roman Zippel6ff58012007-05-01 22:32:43 +0200839 model = (mac_bi_data.cpuid >> 2) & 63;
Finn Thain53aac0a2009-11-04 00:39:09 +1100840 printk(KERN_WARNING "No bootinfo model ID, using cpuid instead "
841 "(obsolete bootloader?)\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700842 }
843
844 macintosh_config = mac_data_table;
Roman Zippel6ff58012007-05-01 22:32:43 +0200845 for (m = macintosh_config; m->ident != -1; m++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700846 if (m->ident == model) {
847 macintosh_config = m;
848 break;
849 }
850 }
851
Finn Thain80614e52009-11-17 20:06:48 +1100852 /* Set up serial port resources for the console initcall. */
853
854 scc_a_rsrcs[0].start = (resource_size_t) mac_bi_data.sccbase + 2;
855 scc_a_rsrcs[0].end = scc_a_rsrcs[0].start;
856 scc_b_rsrcs[0].start = (resource_size_t) mac_bi_data.sccbase;
857 scc_b_rsrcs[0].end = scc_b_rsrcs[0].start;
858
859 switch (macintosh_config->scc_type) {
860 case MAC_SCC_PSC:
861 scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC_A;
862 scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC_B;
863 break;
864 default:
Finn Thainda3fb3c2011-10-24 01:11:18 +1100865 /* On non-PSC machines, the serial ports share an IRQ. */
866 if (macintosh_config->ident == MAC_MODEL_IIFX) {
867 scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC;
868 scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC;
869 } else {
870 scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_AUTO_4;
871 scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_AUTO_4;
872 }
Finn Thain80614e52009-11-17 20:06:48 +1100873 break;
874 }
875
Finn Thain53aac0a2009-11-04 00:39:09 +1100876 /*
877 * We need to pre-init the IOPs, if any. Otherwise
878 * the serial console won't work if the user had
879 * the serial ports set to "Faster" mode in MacOS.
880 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700881 iop_preinit();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700882
Frans Popb9b0d8b2010-02-06 18:47:11 +0100883 printk(KERN_INFO "Detected Macintosh model: %d\n", model);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700884
885 /*
886 * Report booter data:
887 */
Roman Zippel6ff58012007-05-01 22:32:43 +0200888 printk(KERN_DEBUG " Penguin bootinfo data:\n");
Finn Thain53aac0a2009-11-04 00:39:09 +1100889 printk(KERN_DEBUG " Video: addr 0x%lx "
890 "row 0x%lx depth %lx dimensions %ld x %ld\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700891 mac_bi_data.videoaddr, mac_bi_data.videorow,
892 mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF,
893 mac_bi_data.dimensions >> 16);
Frans Popb9b0d8b2010-02-06 18:47:11 +0100894 printk(KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700895 mac_bi_data.videological, mac_orig_videoaddr,
896 mac_bi_data.sccbase);
Frans Popb9b0d8b2010-02-06 18:47:11 +0100897 printk(KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700898 mac_bi_data.boottime, mac_bi_data.gmtbias);
Frans Popb9b0d8b2010-02-06 18:47:11 +0100899 printk(KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700900 mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700901
Linus Torvalds1da177e2005-04-16 15:20:36 -0700902 iop_init();
903 via_init();
904 oss_init();
905 psc_init();
906 baboon_init();
Finn Thain18814ee2009-11-17 20:03:05 +1100907
908#ifdef CONFIG_ADB_CUDA
909 find_via_cuda();
910#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700911}
912
Adrian Bunk8dfbdf42008-07-17 21:16:25 +0200913static void __init mac_report_hardware(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700914{
915 printk(KERN_INFO "Apple Macintosh %s\n", macintosh_config->name);
916}
917
918static void mac_get_model(char *str)
919{
Roman Zippel6ff58012007-05-01 22:32:43 +0200920 strcpy(str, "Macintosh ");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700921 strcat(str, macintosh_config->name);
922}
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100923
Finn Thain2724daf2009-11-04 00:39:56 +1100924static struct resource swim_rsrc = { .flags = IORESOURCE_MEM };
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100925
Finn Thain2724daf2009-11-04 00:39:56 +1100926static struct platform_device swim_pdev = {
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100927 .name = "swim",
928 .id = -1,
Finn Thain2724daf2009-11-04 00:39:56 +1100929 .num_resources = 1,
930 .resource = &swim_rsrc,
Laurent Vivier8852ecd2008-11-15 16:10:10 +0100931};
932
Finn Thaincbad48d2014-11-12 16:12:07 +1100933static const struct resource mac_scsi_iifx_rsrc[] __initconst = {
934 {
935 .flags = IORESOURCE_IRQ,
936 .start = IRQ_MAC_SCSI,
937 .end = IRQ_MAC_SCSI,
938 }, {
939 .flags = IORESOURCE_MEM,
940 .start = 0x50008000,
941 .end = 0x50009FFF,
942 },
943};
944
945static const struct resource mac_scsi_duo_rsrc[] __initconst = {
946 {
947 .flags = IORESOURCE_MEM,
948 .start = 0xFEE02000,
949 .end = 0xFEE03FFF,
950 },
951};
952
953static const struct resource mac_scsi_old_rsrc[] __initconst = {
954 {
955 .flags = IORESOURCE_IRQ,
956 .start = IRQ_MAC_SCSI,
957 .end = IRQ_MAC_SCSI,
958 }, {
959 .flags = IORESOURCE_MEM,
960 .start = 0x50010000,
961 .end = 0x50011FFF,
962 }, {
963 .flags = IORESOURCE_MEM,
964 .start = 0x50006000,
965 .end = 0x50007FFF,
966 },
967};
968
969static const struct resource mac_scsi_late_rsrc[] __initconst = {
970 {
971 .flags = IORESOURCE_IRQ,
972 .start = IRQ_MAC_SCSI,
973 .end = IRQ_MAC_SCSI,
974 }, {
975 .flags = IORESOURCE_MEM,
976 .start = 0x50010000,
977 .end = 0x50011FFF,
978 },
979};
980
981static const struct resource mac_scsi_ccl_rsrc[] __initconst = {
982 {
983 .flags = IORESOURCE_IRQ,
984 .start = IRQ_MAC_SCSI,
985 .end = IRQ_MAC_SCSI,
986 }, {
987 .flags = IORESOURCE_MEM,
988 .start = 0x50F10000,
989 .end = 0x50F11FFF,
990 }, {
991 .flags = IORESOURCE_MEM,
992 .start = 0x50F06000,
993 .end = 0x50F07FFF,
994 },
995};
996
Finn Thaincff75f12009-11-04 00:41:35 +1100997static struct platform_device esp_0_pdev = {
998 .name = "mac_esp",
999 .id = 0,
1000};
1001
1002static struct platform_device esp_1_pdev = {
1003 .name = "mac_esp",
1004 .id = 1,
1005};
1006
Finn Thaineeb9c182009-11-04 00:42:02 +11001007static struct platform_device sonic_pdev = {
1008 .name = "macsonic",
1009 .id = -1,
1010};
1011
1012static struct platform_device mace_pdev = {
1013 .name = "macmace",
1014 .id = -1,
1015};
1016
Laurent Vivier8852ecd2008-11-15 16:10:10 +01001017int __init mac_platform_init(void)
1018{
1019 u8 *swim_base;
1020
Geert Uytterhoeven6cfeba52012-03-18 13:21:38 +01001021 if (!MACH_IS_MAC)
1022 return -ENODEV;
1023
Finn Thain2724daf2009-11-04 00:39:56 +11001024 /*
Finn Thain80614e52009-11-17 20:06:48 +11001025 * Serial devices
1026 */
1027
1028 platform_device_register(&scc_a_pdev);
1029 platform_device_register(&scc_b_pdev);
1030
1031 /*
Finn Thain2724daf2009-11-04 00:39:56 +11001032 * Floppy device
1033 */
1034
Laurent Vivier8852ecd2008-11-15 16:10:10 +01001035 switch (macintosh_config->floppy_type) {
1036 case MAC_FLOPPY_SWIM_ADDR1:
1037 swim_base = (u8 *)(VIA1_BASE + 0x1E000);
1038 break;
1039 case MAC_FLOPPY_SWIM_ADDR2:
1040 swim_base = (u8 *)(VIA1_BASE + 0x16000);
1041 break;
1042 default:
Finn Thain2724daf2009-11-04 00:39:56 +11001043 swim_base = NULL;
1044 break;
Laurent Vivier8852ecd2008-11-15 16:10:10 +01001045 }
1046
Finn Thain2724daf2009-11-04 00:39:56 +11001047 if (swim_base) {
1048 swim_rsrc.start = (resource_size_t) swim_base,
1049 swim_rsrc.end = (resource_size_t) swim_base + 0x2000,
1050 platform_device_register(&swim_pdev);
1051 }
Laurent Vivier8852ecd2008-11-15 16:10:10 +01001052
Finn Thaincff75f12009-11-04 00:41:35 +11001053 /*
1054 * SCSI device(s)
1055 */
1056
1057 switch (macintosh_config->scsi_type) {
1058 case MAC_SCSI_QUADRA:
1059 case MAC_SCSI_QUADRA3:
1060 platform_device_register(&esp_0_pdev);
1061 break;
1062 case MAC_SCSI_QUADRA2:
1063 platform_device_register(&esp_0_pdev);
1064 if ((macintosh_config->ident == MAC_MODEL_Q900) ||
1065 (macintosh_config->ident == MAC_MODEL_Q950))
1066 platform_device_register(&esp_1_pdev);
1067 break;
Finn Thaincbad48d2014-11-12 16:12:07 +11001068 case MAC_SCSI_IIFX:
1069 /* Addresses from The Guide to Mac Family Hardware.
1070 * $5000 8000 - $5000 9FFF: SCSI DMA
1071 * $5000 C000 - $5000 DFFF: Alternate SCSI (DMA)
1072 * $5000 E000 - $5000 FFFF: Alternate SCSI (Hsk)
1073 * The SCSI DMA custom IC embeds the 53C80 core. mac_scsi does
1074 * not make use of its DMA or hardware handshaking logic.
1075 */
1076 platform_device_register_simple("mac_scsi", 0,
1077 mac_scsi_iifx_rsrc, ARRAY_SIZE(mac_scsi_iifx_rsrc));
1078 break;
1079 case MAC_SCSI_DUO:
1080 /* Addresses from the Duo Dock II Developer Note.
1081 * $FEE0 2000 - $FEE0 3FFF: normal mode
1082 * $FEE0 4000 - $FEE0 5FFF: pseudo DMA without /DRQ
1083 * $FEE0 6000 - $FEE0 7FFF: pseudo DMA with /DRQ
1084 * The NetBSD code indicates that both 5380 chips share
1085 * an IRQ (?) which would need careful handling (see mac_esp).
1086 */
1087 platform_device_register_simple("mac_scsi", 1,
1088 mac_scsi_duo_rsrc, ARRAY_SIZE(mac_scsi_duo_rsrc));
1089 /* fall through */
1090 case MAC_SCSI_OLD:
1091 /* Addresses from Developer Notes for Duo System,
1092 * PowerBook 180 & 160, 140 & 170, Macintosh IIsi
1093 * and also from The Guide to Mac Family Hardware for
1094 * SE/30, II, IIx, IIcx, IIci.
1095 * $5000 6000 - $5000 7FFF: pseudo-DMA with /DRQ
1096 * $5001 0000 - $5001 1FFF: normal mode
1097 * $5001 2000 - $5001 3FFF: pseudo-DMA without /DRQ
1098 * GMFH says that $5000 0000 - $50FF FFFF "wraps
1099 * $5000 0000 - $5001 FFFF eight times" (!)
1100 * mess.org says IIci and Color Classic do not alias
1101 * I/O address space.
1102 */
1103 platform_device_register_simple("mac_scsi", 0,
1104 mac_scsi_old_rsrc, ARRAY_SIZE(mac_scsi_old_rsrc));
1105 break;
1106 case MAC_SCSI_LATE:
1107 /* PDMA logic in 68040 PowerBooks is somehow different to
1108 * '030 models. It's probably more like Quadras (see mac_esp).
1109 */
1110 platform_device_register_simple("mac_scsi", 0,
1111 mac_scsi_late_rsrc, ARRAY_SIZE(mac_scsi_late_rsrc));
1112 break;
Finn Thain2e874d12015-01-07 11:17:35 +11001113 case MAC_SCSI_LC:
1114 /* Addresses from Mac LC data in Designing Cards & Drivers 3ed.
1115 * Also from the Developer Notes for Classic II, LC III,
1116 * Color Classic and IIvx.
Finn Thaincbad48d2014-11-12 16:12:07 +11001117 * $50F0 6000 - $50F0 7FFF: SCSI handshake
1118 * $50F1 0000 - $50F1 1FFF: SCSI
1119 * $50F1 2000 - $50F1 3FFF: SCSI DMA
1120 */
1121 platform_device_register_simple("mac_scsi", 0,
1122 mac_scsi_ccl_rsrc, ARRAY_SIZE(mac_scsi_ccl_rsrc));
1123 break;
Finn Thaincff75f12009-11-04 00:41:35 +11001124 }
1125
Finn Thaineeb9c182009-11-04 00:42:02 +11001126 /*
1127 * Ethernet device
1128 */
1129
1130 switch (macintosh_config->ether_type) {
1131 case MAC_ETHER_SONIC:
1132 platform_device_register(&sonic_pdev);
1133 break;
1134 case MAC_ETHER_MACE:
1135 platform_device_register(&mace_pdev);
1136 break;
1137 }
1138
Finn Thain2724daf2009-11-04 00:39:56 +11001139 return 0;
Laurent Vivier8852ecd2008-11-15 16:10:10 +01001140}
1141
1142arch_initcall(mac_platform_init);