Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | #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 Vivier | 8852ecd | 2008-11-15 16:10:10 +0100 | [diff] [blame] | 25 | #include <linux/platform_device.h> |
Finn Thain | 18814ee | 2009-11-17 20:03:05 +1100 | [diff] [blame] | 26 | #include <linux/adb.h> |
| 27 | #include <linux/cuda.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | |
| 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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | struct mac_booter_data mac_bi_data; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | /* The phys. video addr. - might be bogus on some machines */ |
Adrian Bunk | 8dfbdf4 | 2008-07-17 21:16:25 +0200 | [diff] [blame] | 53 | static unsigned long mac_orig_videoaddr; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | |
| 55 | /* Mac specific timer functions */ |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 56 | extern unsigned long mac_gettimeoffset(void); |
| 57 | extern int mac_hwclk(int, struct rtc_time *); |
| 58 | extern int mac_set_clock_mmss(unsigned long); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | extern void iop_preinit(void); |
| 60 | extern void iop_init(void); |
| 61 | extern void via_init(void); |
David Howells | 40220c1 | 2006-10-09 12:19:47 +0100 | [diff] [blame] | 62 | extern void via_init_clock(irq_handler_t func); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 63 | extern void via_flush_cache(void); |
| 64 | extern void oss_init(void); |
| 65 | extern void psc_init(void); |
| 66 | extern void baboon_init(void); |
| 67 | |
| 68 | extern void mac_mksound(unsigned int, unsigned int); |
| 69 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | static void mac_get_model(char *str); |
Adrian Bunk | 8dfbdf4 | 2008-07-17 21:16:25 +0200 | [diff] [blame] | 71 | static void mac_identify(void); |
| 72 | static void mac_report_hardware(void); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 73 | |
Finn Thain | 93edd02 | 2011-10-24 01:11:12 +1100 | [diff] [blame] | 74 | #ifdef CONFIG_EARLY_PRINTK |
| 75 | asmlinkage void __init mac_early_print(const char *s, unsigned n); |
| 76 | |
| 77 | static void __init mac_early_cons_write(struct console *con, |
| 78 | const char *s, unsigned n) |
| 79 | { |
| 80 | mac_early_print(s, n); |
| 81 | } |
| 82 | |
| 83 | static 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 | |
| 90 | int __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 | |
| 96 | late_initcall(mac_unregister_early_cons); |
| 97 | #endif |
| 98 | |
Al Viro | 66a3f82 | 2007-07-20 04:33:28 +0100 | [diff] [blame] | 99 | static void __init mac_sched_init(irq_handler_t vector) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 100 | { |
| 101 | via_init_clock(vector); |
| 102 | } |
| 103 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 104 | /* |
| 105 | * Parse a Macintosh-specific record in the bootinfo |
| 106 | */ |
| 107 | |
| 108 | int __init mac_parse_bootinfo(const struct bi_record *record) |
| 109 | { |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 110 | int unknown = 0; |
| 111 | const u_long *data = record->data; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 112 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 113 | switch (record->tag) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 114 | case BI_MAC_MODEL: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 115 | mac_bi_data.id = *data; |
| 116 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 117 | case BI_MAC_VADDR: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 118 | mac_bi_data.videoaddr = *data; |
| 119 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 120 | case BI_MAC_VDEPTH: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 121 | mac_bi_data.videodepth = *data; |
| 122 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 123 | case BI_MAC_VROW: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 124 | mac_bi_data.videorow = *data; |
| 125 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 126 | case BI_MAC_VDIM: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 127 | mac_bi_data.dimensions = *data; |
| 128 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 129 | case BI_MAC_VLOGICAL: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 130 | mac_bi_data.videological = VIDEOMEMBASE + (*data & ~VIDEOMEMMASK); |
| 131 | mac_orig_videoaddr = *data; |
| 132 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 133 | case BI_MAC_SCCBASE: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 134 | mac_bi_data.sccbase = *data; |
| 135 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 136 | case BI_MAC_BTIME: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 137 | mac_bi_data.boottime = *data; |
| 138 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 139 | case BI_MAC_GMTBIAS: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 140 | mac_bi_data.gmtbias = *data; |
| 141 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 142 | case BI_MAC_MEMSIZE: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 143 | mac_bi_data.memsize = *data; |
| 144 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 145 | case BI_MAC_CPUID: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 146 | mac_bi_data.cpuid = *data; |
| 147 | break; |
| 148 | case BI_MAC_ROMBASE: |
| 149 | mac_bi_data.rombase = *data; |
| 150 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 151 | default: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 152 | unknown = 1; |
| 153 | break; |
| 154 | } |
| 155 | return unknown; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 156 | } |
| 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 | |
| 164 | static void mac_cache_card_flush(int writeback) |
| 165 | { |
| 166 | unsigned long flags; |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 167 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 168 | local_irq_save(flags); |
| 169 | via_flush_cache(); |
| 170 | local_irq_restore(flags); |
| 171 | } |
| 172 | |
| 173 | void __init config_mac(void) |
| 174 | { |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 175 | if (!MACH_IS_MAC) |
Frans Pop | b9b0d8b | 2010-02-06 18:47:11 +0100 | [diff] [blame] | 176 | printk(KERN_ERR "ERROR: no Mac, but config_mac() called!!\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 177 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 178 | 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 Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 182 | mach_hwclk = mac_hwclk; |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 183 | 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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 187 | mach_max_dma_address = 0xffffffff; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 188 | #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE) |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 189 | mach_beep = mac_mksound; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 190 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 191 | |
Finn Thain | 93edd02 | 2011-10-24 01:11:12 +1100 | [diff] [blame] | 192 | #ifdef CONFIG_EARLY_PRINTK |
| 193 | register_console(&mac_early_cons); |
| 194 | #endif |
| 195 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 196 | /* |
| 197 | * Determine hardware present |
| 198 | */ |
| 199 | |
| 200 | mac_identify(); |
| 201 | mac_report_hardware(); |
| 202 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 203 | /* |
| 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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 208 | |
| 209 | if (macintosh_config->ident == MAC_MODEL_IICI |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 210 | || macintosh_config->ident == MAC_MODEL_IIFX) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 211 | mach_l2_flush = mac_cache_card_flush; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 212 | } |
| 213 | |
| 214 | |
| 215 | /* |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 216 | * Macintosh Table: hardcoded model configuration data. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 217 | * |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 218 | * 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. |
| 224 | * Meaning it should have MAC_VIA_IIci here :-) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 225 | */ |
| 226 | |
| 227 | struct mac_model *macintosh_config; |
| 228 | EXPORT_SYMBOL(macintosh_config); |
| 229 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 230 | static struct mac_model mac_data_table[] = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 231 | /* |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 232 | * We'll pretend to be a Macintosh II, that's pretty safe. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 233 | */ |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 242 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 243 | .floppy_type = MAC_FLOPPY_IWM, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 244 | }, |
| 245 | |
| 246 | /* |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 247 | * Original Mac II hardware |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 248 | */ |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 257 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 258 | .floppy_type = MAC_FLOPPY_IWM, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 259 | }, { |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 266 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 267 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 268 | }, { |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 275 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 276 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 277 | }, { |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 284 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 285 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 286 | }, |
| 287 | |
| 288 | /* |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 289 | * 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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 292 | * 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, |
| 299 | .via_type = MAC_VIA_IIci, |
| 300 | .scsi_type = MAC_SCSI_OLD, |
| 301 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 302 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 303 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 304 | }, { |
| 305 | .ident = MAC_MODEL_IIFX, |
| 306 | .name = "IIfx", |
| 307 | .adb_type = MAC_ADB_IOP, |
| 308 | .via_type = MAC_VIA_IIci, |
| 309 | .scsi_type = MAC_SCSI_OLD, |
| 310 | .scc_type = MAC_SCC_IOP, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 311 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 312 | .floppy_type = MAC_FLOPPY_SWIM_IOP, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 313 | }, { |
| 314 | .ident = MAC_MODEL_IISI, |
| 315 | .name = "IIsi", |
| 316 | .adb_type = MAC_ADB_IISI, |
| 317 | .via_type = MAC_VIA_IIci, |
| 318 | .scsi_type = MAC_SCSI_OLD, |
| 319 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 320 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 321 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 322 | }, { |
| 323 | .ident = MAC_MODEL_IIVI, |
| 324 | .name = "IIvi", |
| 325 | .adb_type = MAC_ADB_IISI, |
| 326 | .via_type = MAC_VIA_IIci, |
| 327 | .scsi_type = MAC_SCSI_OLD, |
| 328 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 329 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 330 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 331 | }, { |
| 332 | .ident = MAC_MODEL_IIVX, |
| 333 | .name = "IIvx", |
| 334 | .adb_type = MAC_ADB_IISI, |
| 335 | .via_type = MAC_VIA_IIci, |
| 336 | .scsi_type = MAC_SCSI_OLD, |
| 337 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 338 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 339 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 340 | }, |
| 341 | |
| 342 | /* |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 343 | * Classic models (guessing: similar to SE/30? Nope, similar to LC...) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 344 | */ |
| 345 | |
| 346 | { |
| 347 | .ident = MAC_MODEL_CLII, |
| 348 | .name = "Classic II", |
| 349 | .adb_type = MAC_ADB_IISI, |
| 350 | .via_type = MAC_VIA_IIci, |
| 351 | .scsi_type = MAC_SCSI_OLD, |
| 352 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 353 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 354 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 355 | }, { |
| 356 | .ident = MAC_MODEL_CCL, |
| 357 | .name = "Color Classic", |
| 358 | .adb_type = MAC_ADB_CUDA, |
| 359 | .via_type = MAC_VIA_IIci, |
| 360 | .scsi_type = MAC_SCSI_OLD, |
| 361 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 362 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 363 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Finn Thain | 1b46010 | 2010-05-29 03:27:18 +1000 | [diff] [blame] | 364 | }, { |
| 365 | .ident = MAC_MODEL_CCLII, |
| 366 | .name = "Color Classic II", |
| 367 | .adb_type = MAC_ADB_CUDA, |
| 368 | .via_type = MAC_VIA_IIci, |
| 369 | .scsi_type = MAC_SCSI_OLD, |
| 370 | .scc_type = MAC_SCC_II, |
| 371 | .nubus_type = MAC_NUBUS, |
| 372 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 373 | }, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 374 | |
| 375 | /* |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 376 | * Some Mac LC machines. Basically the same as the IIci, ADB like IIsi |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 377 | */ |
| 378 | |
| 379 | { |
| 380 | .ident = MAC_MODEL_LC, |
| 381 | .name = "LC", |
| 382 | .adb_type = MAC_ADB_IISI, |
| 383 | .via_type = MAC_VIA_IIci, |
| 384 | .scsi_type = MAC_SCSI_OLD, |
| 385 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 386 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 387 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 388 | }, { |
| 389 | .ident = MAC_MODEL_LCII, |
| 390 | .name = "LC II", |
| 391 | .adb_type = MAC_ADB_IISI, |
| 392 | .via_type = MAC_VIA_IIci, |
| 393 | .scsi_type = MAC_SCSI_OLD, |
| 394 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 395 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 396 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 397 | }, { |
| 398 | .ident = MAC_MODEL_LCIII, |
| 399 | .name = "LC III", |
| 400 | .adb_type = MAC_ADB_IISI, |
| 401 | .via_type = MAC_VIA_IIci, |
| 402 | .scsi_type = MAC_SCSI_OLD, |
| 403 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 404 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 405 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 406 | }, |
| 407 | |
| 408 | /* |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 409 | * 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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 416 | */ |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 425 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 426 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 427 | }, { |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 434 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 435 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 436 | }, { |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 444 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 445 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 446 | }, { |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 455 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 456 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 457 | }, { |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 465 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 466 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 467 | }, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 468 | /* The Q700 does have a NS Sonic */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 469 | { |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 477 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 478 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 479 | }, { |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 487 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 488 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 489 | }, { |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 497 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 498 | .floppy_type = MAC_FLOPPY_AV, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 499 | }, { |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 507 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 508 | .floppy_type = MAC_FLOPPY_SWIM_IOP, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 509 | }, { |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 517 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 518 | .floppy_type = MAC_FLOPPY_SWIM_IOP, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 519 | }, |
| 520 | |
| 521 | /* |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 522 | * Performa - more LC type machines |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 523 | */ |
| 524 | |
| 525 | { |
| 526 | .ident = MAC_MODEL_P460, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 527 | .name = "Performa 460", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 528 | .adb_type = MAC_ADB_IISI, |
| 529 | .via_type = MAC_VIA_IIci, |
| 530 | .scsi_type = MAC_SCSI_OLD, |
| 531 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 532 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 533 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 534 | }, { |
| 535 | .ident = MAC_MODEL_P475, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 536 | .name = "Performa 475", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 537 | .adb_type = MAC_ADB_CUDA, |
| 538 | .via_type = MAC_VIA_QUADRA, |
| 539 | .scsi_type = MAC_SCSI_QUADRA, |
| 540 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 541 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 542 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 543 | }, { |
| 544 | .ident = MAC_MODEL_P475F, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 545 | .name = "Performa 475", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 546 | .adb_type = MAC_ADB_CUDA, |
| 547 | .via_type = MAC_VIA_QUADRA, |
| 548 | .scsi_type = MAC_SCSI_QUADRA, |
| 549 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 550 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 551 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 552 | }, { |
| 553 | .ident = MAC_MODEL_P520, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 554 | .name = "Performa 520", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 555 | .adb_type = MAC_ADB_CUDA, |
| 556 | .via_type = MAC_VIA_IIci, |
| 557 | .scsi_type = MAC_SCSI_OLD, |
| 558 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 559 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 560 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 561 | }, { |
| 562 | .ident = MAC_MODEL_P550, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 563 | .name = "Performa 550", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 564 | .adb_type = MAC_ADB_CUDA, |
| 565 | .via_type = MAC_VIA_IIci, |
| 566 | .scsi_type = MAC_SCSI_OLD, |
| 567 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 568 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 569 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 570 | }, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 571 | /* These have the comm slot, and therefore possibly SONIC ethernet */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 572 | { |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 580 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 581 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 582 | }, { |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 591 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 592 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 593 | }, { |
| 594 | .ident = MAC_MODEL_TV, |
| 595 | .name = "TV", |
| 596 | .adb_type = MAC_ADB_CUDA, |
Finn Thain | 8d9f014 | 2011-10-24 01:11:16 +1100 | [diff] [blame] | 597 | .via_type = MAC_VIA_IIci, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 598 | .scsi_type = MAC_SCSI_OLD, |
| 599 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 600 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 601 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 602 | }, { |
| 603 | .ident = MAC_MODEL_P600, |
| 604 | .name = "Performa 600", |
| 605 | .adb_type = MAC_ADB_IISI, |
| 606 | .via_type = MAC_VIA_IIci, |
| 607 | .scsi_type = MAC_SCSI_OLD, |
| 608 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 609 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 610 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 611 | }, |
| 612 | |
| 613 | /* |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 614 | * Centris - just guessing again; maybe like Quadra. |
| 615 | * The C610 may or may not have SONIC. We probe to make sure. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 616 | */ |
| 617 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 618 | { |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 626 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 627 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 628 | }, { |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 636 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 637 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 638 | }, { |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 646 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 647 | .floppy_type = MAC_FLOPPY_AV, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 648 | }, |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 663 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 664 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 665 | }, { |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 672 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 673 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 674 | }, { |
| 675 | .ident = MAC_MODEL_PB150, |
| 676 | .name = "PowerBook 150", |
Finn Thain | 4107c45 | 2011-10-24 01:11:20 +1100 | [diff] [blame^] | 677 | .adb_type = MAC_ADB_PB2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 678 | .via_type = MAC_VIA_IIci, |
| 679 | .scsi_type = MAC_SCSI_OLD, |
| 680 | .ide_type = MAC_IDE_PB, |
| 681 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 682 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 683 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 684 | }, { |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 691 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 692 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 693 | }, { |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 700 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 701 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 702 | }, { |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 709 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 710 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 711 | }, { |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 718 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 719 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 720 | }, { |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 727 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 728 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 729 | }, { |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 736 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 737 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 738 | }, { |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 746 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 747 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 748 | }, { |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 756 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 757 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 758 | }, |
| 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. |
| 764 | * |
Simon Arlott | 0c79cf6 | 2007-10-20 01:20:32 +0200 | [diff] [blame] | 765 | * Are these really MAC_VIA_IIci? The developer notes for the |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 766 | * Duos show pretty much the same custom parts as in most of |
| 767 | * the other PowerBooks which would imply MAC_VIA_QUADRA. |
| 768 | */ |
| 769 | |
| 770 | { |
| 771 | .ident = MAC_MODEL_PB210, |
| 772 | .name = "PowerBook Duo 210", |
| 773 | .adb_type = MAC_ADB_PB2, |
| 774 | .via_type = MAC_VIA_IIci, |
| 775 | .scsi_type = MAC_SCSI_OLD, |
| 776 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 777 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 778 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 779 | }, { |
| 780 | .ident = MAC_MODEL_PB230, |
| 781 | .name = "PowerBook Duo 230", |
| 782 | .adb_type = MAC_ADB_PB2, |
| 783 | .via_type = MAC_VIA_IIci, |
| 784 | .scsi_type = MAC_SCSI_OLD, |
| 785 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 786 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 787 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 788 | }, { |
| 789 | .ident = MAC_MODEL_PB250, |
| 790 | .name = "PowerBook Duo 250", |
| 791 | .adb_type = MAC_ADB_PB2, |
| 792 | .via_type = MAC_VIA_IIci, |
| 793 | .scsi_type = MAC_SCSI_OLD, |
| 794 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 795 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 796 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 797 | }, { |
| 798 | .ident = MAC_MODEL_PB270C, |
| 799 | .name = "PowerBook Duo 270c", |
| 800 | .adb_type = MAC_ADB_PB2, |
| 801 | .via_type = MAC_VIA_IIci, |
| 802 | .scsi_type = MAC_SCSI_OLD, |
| 803 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 804 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 805 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 806 | }, { |
| 807 | .ident = MAC_MODEL_PB280, |
| 808 | .name = "PowerBook Duo 280", |
| 809 | .adb_type = MAC_ADB_PB2, |
| 810 | .via_type = MAC_VIA_IIci, |
| 811 | .scsi_type = MAC_SCSI_OLD, |
| 812 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 813 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 814 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 815 | }, { |
| 816 | .ident = MAC_MODEL_PB280C, |
| 817 | .name = "PowerBook Duo 280c", |
| 818 | .adb_type = MAC_ADB_PB2, |
| 819 | .via_type = MAC_VIA_IIci, |
| 820 | .scsi_type = MAC_SCSI_OLD, |
| 821 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 822 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 823 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 824 | }, |
| 825 | |
| 826 | /* |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 827 | * Other stuff? |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 828 | */ |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 829 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 830 | { |
| 831 | .ident = -1 |
| 832 | } |
| 833 | }; |
| 834 | |
Finn Thain | 80614e5 | 2009-11-17 20:06:48 +1100 | [diff] [blame] | 835 | static struct resource scc_a_rsrcs[] = { |
| 836 | { .flags = IORESOURCE_MEM }, |
| 837 | { .flags = IORESOURCE_IRQ }, |
| 838 | }; |
| 839 | |
| 840 | static struct resource scc_b_rsrcs[] = { |
| 841 | { .flags = IORESOURCE_MEM }, |
| 842 | { .flags = IORESOURCE_IRQ }, |
| 843 | }; |
| 844 | |
| 845 | struct platform_device scc_a_pdev = { |
| 846 | .name = "scc", |
| 847 | .id = 0, |
| 848 | .num_resources = ARRAY_SIZE(scc_a_rsrcs), |
| 849 | .resource = scc_a_rsrcs, |
| 850 | }; |
| 851 | EXPORT_SYMBOL(scc_a_pdev); |
| 852 | |
| 853 | struct platform_device scc_b_pdev = { |
| 854 | .name = "scc", |
| 855 | .id = 1, |
| 856 | .num_resources = ARRAY_SIZE(scc_b_rsrcs), |
| 857 | .resource = scc_b_rsrcs, |
| 858 | }; |
| 859 | EXPORT_SYMBOL(scc_b_pdev); |
| 860 | |
Adrian Bunk | 8dfbdf4 | 2008-07-17 21:16:25 +0200 | [diff] [blame] | 861 | static void __init mac_identify(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 862 | { |
| 863 | struct mac_model *m; |
| 864 | |
| 865 | /* Penguin data useful? */ |
| 866 | int model = mac_bi_data.id; |
| 867 | if (!model) { |
| 868 | /* no bootinfo model id -> NetBSD booter was used! */ |
| 869 | /* XXX FIXME: breaks for model > 31 */ |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 870 | model = (mac_bi_data.cpuid >> 2) & 63; |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 871 | printk(KERN_WARNING "No bootinfo model ID, using cpuid instead " |
| 872 | "(obsolete bootloader?)\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 873 | } |
| 874 | |
| 875 | macintosh_config = mac_data_table; |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 876 | for (m = macintosh_config; m->ident != -1; m++) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 877 | if (m->ident == model) { |
| 878 | macintosh_config = m; |
| 879 | break; |
| 880 | } |
| 881 | } |
| 882 | |
Finn Thain | 80614e5 | 2009-11-17 20:06:48 +1100 | [diff] [blame] | 883 | /* Set up serial port resources for the console initcall. */ |
| 884 | |
| 885 | scc_a_rsrcs[0].start = (resource_size_t) mac_bi_data.sccbase + 2; |
| 886 | scc_a_rsrcs[0].end = scc_a_rsrcs[0].start; |
| 887 | scc_b_rsrcs[0].start = (resource_size_t) mac_bi_data.sccbase; |
| 888 | scc_b_rsrcs[0].end = scc_b_rsrcs[0].start; |
| 889 | |
| 890 | switch (macintosh_config->scc_type) { |
| 891 | case MAC_SCC_PSC: |
| 892 | scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC_A; |
| 893 | scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC_B; |
| 894 | break; |
| 895 | default: |
Finn Thain | da3fb3c | 2011-10-24 01:11:18 +1100 | [diff] [blame] | 896 | /* On non-PSC machines, the serial ports share an IRQ. */ |
| 897 | if (macintosh_config->ident == MAC_MODEL_IIFX) { |
| 898 | scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC; |
| 899 | scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC; |
| 900 | } else { |
| 901 | scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_AUTO_4; |
| 902 | scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_AUTO_4; |
| 903 | } |
Finn Thain | 80614e5 | 2009-11-17 20:06:48 +1100 | [diff] [blame] | 904 | break; |
| 905 | } |
| 906 | |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 907 | /* |
| 908 | * We need to pre-init the IOPs, if any. Otherwise |
| 909 | * the serial console won't work if the user had |
| 910 | * the serial ports set to "Faster" mode in MacOS. |
| 911 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 912 | iop_preinit(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 913 | |
Frans Pop | b9b0d8b | 2010-02-06 18:47:11 +0100 | [diff] [blame] | 914 | printk(KERN_INFO "Detected Macintosh model: %d\n", model); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 915 | |
| 916 | /* |
| 917 | * Report booter data: |
| 918 | */ |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 919 | printk(KERN_DEBUG " Penguin bootinfo data:\n"); |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 920 | printk(KERN_DEBUG " Video: addr 0x%lx " |
| 921 | "row 0x%lx depth %lx dimensions %ld x %ld\n", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 922 | mac_bi_data.videoaddr, mac_bi_data.videorow, |
| 923 | mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF, |
| 924 | mac_bi_data.dimensions >> 16); |
Frans Pop | b9b0d8b | 2010-02-06 18:47:11 +0100 | [diff] [blame] | 925 | printk(KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx\n", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 926 | mac_bi_data.videological, mac_orig_videoaddr, |
| 927 | mac_bi_data.sccbase); |
Frans Pop | b9b0d8b | 2010-02-06 18:47:11 +0100 | [diff] [blame] | 928 | printk(KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx\n", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 929 | mac_bi_data.boottime, mac_bi_data.gmtbias); |
Frans Pop | b9b0d8b | 2010-02-06 18:47:11 +0100 | [diff] [blame] | 930 | printk(KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx\n", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 931 | mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 932 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 933 | iop_init(); |
| 934 | via_init(); |
| 935 | oss_init(); |
| 936 | psc_init(); |
| 937 | baboon_init(); |
Finn Thain | 18814ee | 2009-11-17 20:03:05 +1100 | [diff] [blame] | 938 | |
| 939 | #ifdef CONFIG_ADB_CUDA |
| 940 | find_via_cuda(); |
| 941 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 942 | } |
| 943 | |
Adrian Bunk | 8dfbdf4 | 2008-07-17 21:16:25 +0200 | [diff] [blame] | 944 | static void __init mac_report_hardware(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 945 | { |
| 946 | printk(KERN_INFO "Apple Macintosh %s\n", macintosh_config->name); |
| 947 | } |
| 948 | |
| 949 | static void mac_get_model(char *str) |
| 950 | { |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 951 | strcpy(str, "Macintosh "); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 952 | strcat(str, macintosh_config->name); |
| 953 | } |
Laurent Vivier | 8852ecd | 2008-11-15 16:10:10 +0100 | [diff] [blame] | 954 | |
Finn Thain | 2724daf | 2009-11-04 00:39:56 +1100 | [diff] [blame] | 955 | static struct resource swim_rsrc = { .flags = IORESOURCE_MEM }; |
Laurent Vivier | 8852ecd | 2008-11-15 16:10:10 +0100 | [diff] [blame] | 956 | |
Finn Thain | 2724daf | 2009-11-04 00:39:56 +1100 | [diff] [blame] | 957 | static struct platform_device swim_pdev = { |
Laurent Vivier | 8852ecd | 2008-11-15 16:10:10 +0100 | [diff] [blame] | 958 | .name = "swim", |
| 959 | .id = -1, |
Finn Thain | 2724daf | 2009-11-04 00:39:56 +1100 | [diff] [blame] | 960 | .num_resources = 1, |
| 961 | .resource = &swim_rsrc, |
Laurent Vivier | 8852ecd | 2008-11-15 16:10:10 +0100 | [diff] [blame] | 962 | }; |
| 963 | |
Finn Thain | cff75f1 | 2009-11-04 00:41:35 +1100 | [diff] [blame] | 964 | static struct platform_device esp_0_pdev = { |
| 965 | .name = "mac_esp", |
| 966 | .id = 0, |
| 967 | }; |
| 968 | |
| 969 | static struct platform_device esp_1_pdev = { |
| 970 | .name = "mac_esp", |
| 971 | .id = 1, |
| 972 | }; |
| 973 | |
Finn Thain | eeb9c18 | 2009-11-04 00:42:02 +1100 | [diff] [blame] | 974 | static struct platform_device sonic_pdev = { |
| 975 | .name = "macsonic", |
| 976 | .id = -1, |
| 977 | }; |
| 978 | |
| 979 | static struct platform_device mace_pdev = { |
| 980 | .name = "macmace", |
| 981 | .id = -1, |
| 982 | }; |
| 983 | |
Laurent Vivier | 8852ecd | 2008-11-15 16:10:10 +0100 | [diff] [blame] | 984 | int __init mac_platform_init(void) |
| 985 | { |
| 986 | u8 *swim_base; |
| 987 | |
Finn Thain | 2724daf | 2009-11-04 00:39:56 +1100 | [diff] [blame] | 988 | /* |
Finn Thain | 80614e5 | 2009-11-17 20:06:48 +1100 | [diff] [blame] | 989 | * Serial devices |
| 990 | */ |
| 991 | |
| 992 | platform_device_register(&scc_a_pdev); |
| 993 | platform_device_register(&scc_b_pdev); |
| 994 | |
| 995 | /* |
Finn Thain | 2724daf | 2009-11-04 00:39:56 +1100 | [diff] [blame] | 996 | * Floppy device |
| 997 | */ |
| 998 | |
Laurent Vivier | 8852ecd | 2008-11-15 16:10:10 +0100 | [diff] [blame] | 999 | switch (macintosh_config->floppy_type) { |
| 1000 | case MAC_FLOPPY_SWIM_ADDR1: |
| 1001 | swim_base = (u8 *)(VIA1_BASE + 0x1E000); |
| 1002 | break; |
| 1003 | case MAC_FLOPPY_SWIM_ADDR2: |
| 1004 | swim_base = (u8 *)(VIA1_BASE + 0x16000); |
| 1005 | break; |
| 1006 | default: |
Finn Thain | 2724daf | 2009-11-04 00:39:56 +1100 | [diff] [blame] | 1007 | swim_base = NULL; |
| 1008 | break; |
Laurent Vivier | 8852ecd | 2008-11-15 16:10:10 +0100 | [diff] [blame] | 1009 | } |
| 1010 | |
Finn Thain | 2724daf | 2009-11-04 00:39:56 +1100 | [diff] [blame] | 1011 | if (swim_base) { |
| 1012 | swim_rsrc.start = (resource_size_t) swim_base, |
| 1013 | swim_rsrc.end = (resource_size_t) swim_base + 0x2000, |
| 1014 | platform_device_register(&swim_pdev); |
| 1015 | } |
Laurent Vivier | 8852ecd | 2008-11-15 16:10:10 +0100 | [diff] [blame] | 1016 | |
Finn Thain | cff75f1 | 2009-11-04 00:41:35 +1100 | [diff] [blame] | 1017 | /* |
| 1018 | * SCSI device(s) |
| 1019 | */ |
| 1020 | |
| 1021 | switch (macintosh_config->scsi_type) { |
| 1022 | case MAC_SCSI_QUADRA: |
| 1023 | case MAC_SCSI_QUADRA3: |
| 1024 | platform_device_register(&esp_0_pdev); |
| 1025 | break; |
| 1026 | case MAC_SCSI_QUADRA2: |
| 1027 | platform_device_register(&esp_0_pdev); |
| 1028 | if ((macintosh_config->ident == MAC_MODEL_Q900) || |
| 1029 | (macintosh_config->ident == MAC_MODEL_Q950)) |
| 1030 | platform_device_register(&esp_1_pdev); |
| 1031 | break; |
| 1032 | } |
| 1033 | |
Finn Thain | eeb9c18 | 2009-11-04 00:42:02 +1100 | [diff] [blame] | 1034 | /* |
| 1035 | * Ethernet device |
| 1036 | */ |
| 1037 | |
| 1038 | switch (macintosh_config->ether_type) { |
| 1039 | case MAC_ETHER_SONIC: |
| 1040 | platform_device_register(&sonic_pdev); |
| 1041 | break; |
| 1042 | case MAC_ETHER_MACE: |
| 1043 | platform_device_register(&mace_pdev); |
| 1044 | break; |
| 1045 | } |
| 1046 | |
Finn Thain | 2724daf | 2009-11-04 00:39:56 +1100 | [diff] [blame] | 1047 | return 0; |
Laurent Vivier | 8852ecd | 2008-11-15 16:10:10 +0100 | [diff] [blame] | 1048 | } |
| 1049 | |
| 1050 | arch_initcall(mac_platform_init); |