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> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | |
| 27 | #define BOOTINFO_COMPAT_1_0 |
| 28 | #include <asm/setup.h> |
| 29 | #include <asm/bootinfo.h> |
| 30 | |
| 31 | #include <asm/system.h> |
| 32 | #include <asm/io.h> |
| 33 | #include <asm/irq.h> |
| 34 | #include <asm/pgtable.h> |
| 35 | #include <asm/rtc.h> |
| 36 | #include <asm/machdep.h> |
| 37 | |
| 38 | #include <asm/macintosh.h> |
| 39 | #include <asm/macints.h> |
| 40 | #include <asm/machw.h> |
| 41 | |
| 42 | #include <asm/mac_iop.h> |
| 43 | #include <asm/mac_via.h> |
| 44 | #include <asm/mac_oss.h> |
| 45 | #include <asm/mac_psc.h> |
| 46 | |
Laurent Vivier | 8852ecd | 2008-11-15 16:10:10 +0100 | [diff] [blame] | 47 | /* platform device info */ |
| 48 | |
| 49 | #define SWIM_IO_SIZE 0x2000 /* SWIM IO resource size */ |
| 50 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | /* Mac bootinfo struct */ |
| 52 | |
| 53 | struct mac_booter_data mac_bi_data; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 55 | /* The phys. video addr. - might be bogus on some machines */ |
Adrian Bunk | 8dfbdf4 | 2008-07-17 21:16:25 +0200 | [diff] [blame] | 56 | static unsigned long mac_orig_videoaddr; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | |
| 58 | /* Mac specific timer functions */ |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 59 | extern unsigned long mac_gettimeoffset(void); |
| 60 | extern int mac_hwclk(int, struct rtc_time *); |
| 61 | extern int mac_set_clock_mmss(unsigned long); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 62 | extern void iop_preinit(void); |
| 63 | extern void iop_init(void); |
| 64 | extern void via_init(void); |
David Howells | 40220c1 | 2006-10-09 12:19:47 +0100 | [diff] [blame] | 65 | extern void via_init_clock(irq_handler_t func); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 66 | extern void via_flush_cache(void); |
| 67 | extern void oss_init(void); |
| 68 | extern void psc_init(void); |
| 69 | extern void baboon_init(void); |
| 70 | |
| 71 | extern void mac_mksound(unsigned int, unsigned int); |
| 72 | |
| 73 | extern void nubus_sweep_video(void); |
| 74 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 75 | static void mac_get_model(char *str); |
Adrian Bunk | 8dfbdf4 | 2008-07-17 21:16:25 +0200 | [diff] [blame] | 76 | static void mac_identify(void); |
| 77 | static void mac_report_hardware(void); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 78 | |
Al Viro | 66a3f82 | 2007-07-20 04:33:28 +0100 | [diff] [blame] | 79 | static void __init mac_sched_init(irq_handler_t vector) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 80 | { |
| 81 | via_init_clock(vector); |
| 82 | } |
| 83 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 84 | /* |
| 85 | * Parse a Macintosh-specific record in the bootinfo |
| 86 | */ |
| 87 | |
| 88 | int __init mac_parse_bootinfo(const struct bi_record *record) |
| 89 | { |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 90 | int unknown = 0; |
| 91 | const u_long *data = record->data; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 92 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 93 | switch (record->tag) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 94 | case BI_MAC_MODEL: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 95 | mac_bi_data.id = *data; |
| 96 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 97 | case BI_MAC_VADDR: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 98 | mac_bi_data.videoaddr = *data; |
| 99 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 100 | case BI_MAC_VDEPTH: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 101 | mac_bi_data.videodepth = *data; |
| 102 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 103 | case BI_MAC_VROW: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 104 | mac_bi_data.videorow = *data; |
| 105 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 106 | case BI_MAC_VDIM: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 107 | mac_bi_data.dimensions = *data; |
| 108 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 109 | case BI_MAC_VLOGICAL: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 110 | mac_bi_data.videological = VIDEOMEMBASE + (*data & ~VIDEOMEMMASK); |
| 111 | mac_orig_videoaddr = *data; |
| 112 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 113 | case BI_MAC_SCCBASE: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 114 | mac_bi_data.sccbase = *data; |
| 115 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 116 | case BI_MAC_BTIME: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 117 | mac_bi_data.boottime = *data; |
| 118 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 119 | case BI_MAC_GMTBIAS: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 120 | mac_bi_data.gmtbias = *data; |
| 121 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 122 | case BI_MAC_MEMSIZE: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 123 | mac_bi_data.memsize = *data; |
| 124 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 125 | case BI_MAC_CPUID: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 126 | mac_bi_data.cpuid = *data; |
| 127 | break; |
| 128 | case BI_MAC_ROMBASE: |
| 129 | mac_bi_data.rombase = *data; |
| 130 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 131 | default: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 132 | unknown = 1; |
| 133 | break; |
| 134 | } |
| 135 | return unknown; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 136 | } |
| 137 | |
| 138 | /* |
| 139 | * Flip into 24bit mode for an instant - flushes the L2 cache card. We |
| 140 | * have to disable interrupts for this. Our IRQ handlers will crap |
| 141 | * themselves if they take an IRQ in 24bit mode! |
| 142 | */ |
| 143 | |
| 144 | static void mac_cache_card_flush(int writeback) |
| 145 | { |
| 146 | unsigned long flags; |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 147 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 148 | local_irq_save(flags); |
| 149 | via_flush_cache(); |
| 150 | local_irq_restore(flags); |
| 151 | } |
| 152 | |
| 153 | void __init config_mac(void) |
| 154 | { |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 155 | if (!MACH_IS_MAC) |
| 156 | printk(KERN_ERR "ERROR: no Mac, but config_mac() called!! \n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 157 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 158 | mach_sched_init = mac_sched_init; |
| 159 | mach_init_IRQ = mac_init_IRQ; |
| 160 | mach_get_model = mac_get_model; |
| 161 | mach_gettimeoffset = mac_gettimeoffset; |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 162 | mach_hwclk = mac_hwclk; |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 163 | mach_set_clock_mmss = mac_set_clock_mmss; |
| 164 | mach_reset = mac_reset; |
| 165 | mach_halt = mac_poweroff; |
| 166 | mach_power_off = mac_poweroff; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 167 | mach_max_dma_address = 0xffffffff; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 168 | #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE) |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 169 | mach_beep = mac_mksound; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 170 | #endif |
| 171 | #ifdef CONFIG_HEARTBEAT |
| 172 | #if 0 |
| 173 | mach_heartbeat = mac_heartbeat; |
| 174 | mach_heartbeat_irq = IRQ_MAC_TIMER; |
| 175 | #endif |
| 176 | #endif |
| 177 | |
| 178 | /* |
| 179 | * Determine hardware present |
| 180 | */ |
| 181 | |
| 182 | mac_identify(); |
| 183 | mac_report_hardware(); |
| 184 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 185 | /* |
| 186 | * AFAIK only the IIci takes a cache card. The IIfx has onboard |
| 187 | * cache ... someone needs to figure out how to tell if it's on or |
| 188 | * not. |
| 189 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 190 | |
| 191 | if (macintosh_config->ident == MAC_MODEL_IICI |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 192 | || macintosh_config->ident == MAC_MODEL_IIFX) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 193 | mach_l2_flush = mac_cache_card_flush; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 194 | |
| 195 | /* |
| 196 | * Check for machine specific fixups. |
| 197 | */ |
| 198 | |
| 199 | #ifdef OLD_NUBUS_CODE |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 200 | nubus_sweep_video(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 201 | #endif |
| 202 | } |
| 203 | |
| 204 | |
| 205 | /* |
| 206 | * Macintosh Table: hardcoded model configuration data. |
| 207 | * |
| 208 | * Much of this was defined by Alan, based on who knows what docs. |
| 209 | * I've added a lot more, and some of that was pure guesswork based |
| 210 | * on hardware pages present on the Mac web site. Possibly wildly |
| 211 | * inaccurate, so look here if a new Mac model won't run. Example: if |
| 212 | * a Mac crashes immediately after the VIA1 registers have been dumped |
| 213 | * to the screen, it probably died attempting to read DirB on a RBV. |
| 214 | * Meaning it should have MAC_VIA_IIci here :-) |
| 215 | */ |
| 216 | |
| 217 | struct mac_model *macintosh_config; |
| 218 | EXPORT_SYMBOL(macintosh_config); |
| 219 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 220 | static struct mac_model mac_data_table[] = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 221 | /* |
| 222 | * We'll pretend to be a Macintosh II, that's pretty safe. |
| 223 | */ |
| 224 | |
| 225 | { |
| 226 | .ident = MAC_MODEL_II, |
| 227 | .name = "Unknown", |
| 228 | .adb_type = MAC_ADB_II, |
| 229 | .via_type = MAC_VIA_II, |
| 230 | .scsi_type = MAC_SCSI_OLD, |
| 231 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 232 | .nubus_type = MAC_NUBUS, |
| 233 | .floppy_type = MAC_FLOPPY_IWM |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 234 | }, |
| 235 | |
| 236 | /* |
| 237 | * Original MacII hardware |
| 238 | * |
| 239 | */ |
| 240 | |
| 241 | { |
| 242 | .ident = MAC_MODEL_II, |
| 243 | .name = "II", |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 248 | .nubus_type = MAC_NUBUS, |
| 249 | .floppy_type = MAC_FLOPPY_IWM |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 250 | }, { |
| 251 | .ident = MAC_MODEL_IIX, |
| 252 | .name = "IIx", |
| 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, |
| 258 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 259 | }, { |
| 260 | .ident = MAC_MODEL_IICX, |
| 261 | .name = "IIcx", |
| 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, |
| 267 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 268 | }, { |
| 269 | .ident = MAC_MODEL_SE30, |
| 270 | .name = "SE/30", |
| 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, |
| 276 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 277 | }, |
| 278 | |
| 279 | /* |
Simon Arlott | 0c79cf6 | 2007-10-20 01:20:32 +0200 | [diff] [blame] | 280 | * Weirdified MacII hardware - all subtly different. Gee thanks |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 281 | * Apple. All these boxes seem to have VIA2 in a different place to |
| 282 | * the MacII (+1A000 rather than +4000) |
| 283 | * CSA: see http://developer.apple.com/technotes/hw/hw_09.html |
| 284 | */ |
| 285 | |
| 286 | { |
| 287 | .ident = MAC_MODEL_IICI, |
| 288 | .name = "IIci", |
| 289 | .adb_type = MAC_ADB_II, |
| 290 | .via_type = MAC_VIA_IIci, |
| 291 | .scsi_type = MAC_SCSI_OLD, |
| 292 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 293 | .nubus_type = MAC_NUBUS, |
| 294 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 295 | }, { |
| 296 | .ident = MAC_MODEL_IIFX, |
| 297 | .name = "IIfx", |
| 298 | .adb_type = MAC_ADB_IOP, |
| 299 | .via_type = MAC_VIA_IIci, |
| 300 | .scsi_type = MAC_SCSI_OLD, |
| 301 | .scc_type = MAC_SCC_IOP, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 302 | .nubus_type = MAC_NUBUS, |
| 303 | .floppy_type = MAC_FLOPPY_SWIM_IOP |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 304 | }, { |
| 305 | .ident = MAC_MODEL_IISI, |
| 306 | .name = "IIsi", |
| 307 | .adb_type = MAC_ADB_IISI, |
| 308 | .via_type = MAC_VIA_IIci, |
| 309 | .scsi_type = MAC_SCSI_OLD, |
| 310 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 311 | .nubus_type = MAC_NUBUS, |
| 312 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 313 | }, { |
| 314 | .ident = MAC_MODEL_IIVI, |
| 315 | .name = "IIvi", |
| 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, |
| 321 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 322 | }, { |
| 323 | .ident = MAC_MODEL_IIVX, |
| 324 | .name = "IIvx", |
| 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, |
| 330 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 331 | }, |
| 332 | |
| 333 | /* |
| 334 | * Classic models (guessing: similar to SE/30 ?? Nope, similar to LC ...) |
| 335 | */ |
| 336 | |
| 337 | { |
| 338 | .ident = MAC_MODEL_CLII, |
| 339 | .name = "Classic II", |
| 340 | .adb_type = MAC_ADB_IISI, |
| 341 | .via_type = MAC_VIA_IIci, |
| 342 | .scsi_type = MAC_SCSI_OLD, |
| 343 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 344 | .nubus_type = MAC_NUBUS, |
| 345 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 346 | }, { |
| 347 | .ident = MAC_MODEL_CCL, |
| 348 | .name = "Color Classic", |
| 349 | .adb_type = MAC_ADB_CUDA, |
| 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, |
| 354 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
| 355 | }, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 356 | |
| 357 | /* |
| 358 | * Some Mac LC machines. Basically the same as the IIci, ADB like IIsi |
| 359 | */ |
| 360 | |
| 361 | { |
| 362 | .ident = MAC_MODEL_LC, |
| 363 | .name = "LC", |
| 364 | .adb_type = MAC_ADB_IISI, |
| 365 | .via_type = MAC_VIA_IIci, |
| 366 | .scsi_type = MAC_SCSI_OLD, |
| 367 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 368 | .nubus_type = MAC_NUBUS, |
| 369 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 370 | }, { |
| 371 | .ident = MAC_MODEL_LCII, |
| 372 | .name = "LC II", |
| 373 | .adb_type = MAC_ADB_IISI, |
| 374 | .via_type = MAC_VIA_IIci, |
| 375 | .scsi_type = MAC_SCSI_OLD, |
| 376 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 377 | .nubus_type = MAC_NUBUS, |
| 378 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 379 | }, { |
| 380 | .ident = MAC_MODEL_LCIII, |
| 381 | .name = "LC III", |
| 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, |
| 387 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 388 | }, |
| 389 | |
| 390 | /* |
| 391 | * Quadra. Video is at 0xF9000000, via is like a MacII. We label it differently |
| 392 | * as some of the stuff connected to VIA2 seems different. Better SCSI chip and |
| 393 | * onboard ethernet using a NatSemi SONIC except the 660AV and 840AV which use an |
| 394 | * AMD 79C940 (MACE). |
| 395 | * The 700, 900 and 950 have some I/O chips in the wrong place to |
| 396 | * confuse us. The 840AV has a SCSI location of its own (same as |
| 397 | * the 660AV). |
| 398 | */ |
| 399 | |
| 400 | { |
| 401 | .ident = MAC_MODEL_Q605, |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 407 | .nubus_type = MAC_NUBUS, |
| 408 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 409 | }, { |
| 410 | .ident = MAC_MODEL_Q605_ACC, |
| 411 | .name = "Quadra 605", |
| 412 | .adb_type = MAC_ADB_CUDA, |
| 413 | .via_type = MAC_VIA_QUADRA, |
| 414 | .scsi_type = MAC_SCSI_QUADRA, |
| 415 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 416 | .nubus_type = MAC_NUBUS, |
| 417 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 418 | }, { |
| 419 | .ident = MAC_MODEL_Q610, |
| 420 | .name = "Quadra 610", |
| 421 | .adb_type = MAC_ADB_II, |
| 422 | .via_type = MAC_VIA_QUADRA, |
| 423 | .scsi_type = MAC_SCSI_QUADRA, |
| 424 | .scc_type = MAC_SCC_QUADRA, |
| 425 | .ether_type = MAC_ETHER_SONIC, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 426 | .nubus_type = MAC_NUBUS, |
| 427 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 428 | }, { |
| 429 | .ident = MAC_MODEL_Q630, |
| 430 | .name = "Quadra 630", |
| 431 | .adb_type = MAC_ADB_CUDA, |
| 432 | .via_type = MAC_VIA_QUADRA, |
| 433 | .scsi_type = MAC_SCSI_QUADRA, |
| 434 | .ide_type = MAC_IDE_QUADRA, |
| 435 | .scc_type = MAC_SCC_QUADRA, |
| 436 | .ether_type = MAC_ETHER_SONIC, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 437 | .nubus_type = MAC_NUBUS, |
| 438 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 439 | }, { |
| 440 | .ident = MAC_MODEL_Q650, |
| 441 | .name = "Quadra 650", |
| 442 | .adb_type = MAC_ADB_II, |
| 443 | .via_type = MAC_VIA_QUADRA, |
| 444 | .scsi_type = MAC_SCSI_QUADRA, |
| 445 | .scc_type = MAC_SCC_QUADRA, |
| 446 | .ether_type = MAC_ETHER_SONIC, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 447 | .nubus_type = MAC_NUBUS, |
| 448 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 449 | }, |
| 450 | /* The Q700 does have a NS Sonic */ |
| 451 | { |
| 452 | .ident = MAC_MODEL_Q700, |
| 453 | .name = "Quadra 700", |
| 454 | .adb_type = MAC_ADB_II, |
| 455 | .via_type = MAC_VIA_QUADRA, |
| 456 | .scsi_type = MAC_SCSI_QUADRA2, |
| 457 | .scc_type = MAC_SCC_QUADRA, |
| 458 | .ether_type = MAC_ETHER_SONIC, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 459 | .nubus_type = MAC_NUBUS, |
| 460 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 461 | }, { |
| 462 | .ident = MAC_MODEL_Q800, |
| 463 | .name = "Quadra 800", |
| 464 | .adb_type = MAC_ADB_II, |
| 465 | .via_type = MAC_VIA_QUADRA, |
| 466 | .scsi_type = MAC_SCSI_QUADRA, |
| 467 | .scc_type = MAC_SCC_QUADRA, |
| 468 | .ether_type = MAC_ETHER_SONIC, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 469 | .nubus_type = MAC_NUBUS, |
| 470 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 471 | }, { |
| 472 | .ident = MAC_MODEL_Q840, |
| 473 | .name = "Quadra 840AV", |
| 474 | .adb_type = MAC_ADB_CUDA, |
| 475 | .via_type = MAC_VIA_QUADRA, |
| 476 | .scsi_type = MAC_SCSI_QUADRA3, |
| 477 | .scc_type = MAC_SCC_PSC, |
| 478 | .ether_type = MAC_ETHER_MACE, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 479 | .nubus_type = MAC_NUBUS, |
| 480 | .floppy_type = MAC_FLOPPY_AV |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 481 | }, { |
| 482 | .ident = MAC_MODEL_Q900, |
| 483 | .name = "Quadra 900", |
| 484 | .adb_type = MAC_ADB_IOP, |
| 485 | .via_type = MAC_VIA_QUADRA, |
| 486 | .scsi_type = MAC_SCSI_QUADRA2, |
| 487 | .scc_type = MAC_SCC_IOP, |
| 488 | .ether_type = MAC_ETHER_SONIC, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 489 | .nubus_type = MAC_NUBUS, |
| 490 | .floppy_type = MAC_FLOPPY_SWIM_IOP |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 491 | }, { |
| 492 | .ident = MAC_MODEL_Q950, |
| 493 | .name = "Quadra 950", |
| 494 | .adb_type = MAC_ADB_IOP, |
| 495 | .via_type = MAC_VIA_QUADRA, |
| 496 | .scsi_type = MAC_SCSI_QUADRA2, |
| 497 | .scc_type = MAC_SCC_IOP, |
| 498 | .ether_type = MAC_ETHER_SONIC, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 499 | .nubus_type = MAC_NUBUS, |
| 500 | .floppy_type = MAC_FLOPPY_SWIM_IOP |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 501 | }, |
| 502 | |
| 503 | /* |
| 504 | * Performa - more LC type machines |
| 505 | */ |
| 506 | |
| 507 | { |
| 508 | .ident = MAC_MODEL_P460, |
| 509 | .name = "Performa 460", |
| 510 | .adb_type = MAC_ADB_IISI, |
| 511 | .via_type = MAC_VIA_IIci, |
| 512 | .scsi_type = MAC_SCSI_OLD, |
| 513 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 514 | .nubus_type = MAC_NUBUS, |
| 515 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 516 | }, { |
| 517 | .ident = MAC_MODEL_P475, |
| 518 | .name = "Performa 475", |
| 519 | .adb_type = MAC_ADB_CUDA, |
| 520 | .via_type = MAC_VIA_QUADRA, |
| 521 | .scsi_type = MAC_SCSI_QUADRA, |
| 522 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 523 | .nubus_type = MAC_NUBUS, |
| 524 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 525 | }, { |
| 526 | .ident = MAC_MODEL_P475F, |
| 527 | .name = "Performa 475", |
| 528 | .adb_type = MAC_ADB_CUDA, |
| 529 | .via_type = MAC_VIA_QUADRA, |
| 530 | .scsi_type = MAC_SCSI_QUADRA, |
| 531 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 532 | .nubus_type = MAC_NUBUS, |
| 533 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 534 | }, { |
| 535 | .ident = MAC_MODEL_P520, |
| 536 | .name = "Performa 520", |
| 537 | .adb_type = MAC_ADB_CUDA, |
| 538 | .via_type = MAC_VIA_IIci, |
| 539 | .scsi_type = MAC_SCSI_OLD, |
| 540 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 541 | .nubus_type = MAC_NUBUS, |
| 542 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 543 | }, { |
| 544 | .ident = MAC_MODEL_P550, |
| 545 | .name = "Performa 550", |
| 546 | .adb_type = MAC_ADB_CUDA, |
| 547 | .via_type = MAC_VIA_IIci, |
| 548 | .scsi_type = MAC_SCSI_OLD, |
| 549 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 550 | .nubus_type = MAC_NUBUS, |
| 551 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 552 | }, |
| 553 | /* These have the comm slot, and therefore the possibility of SONIC ethernet */ |
| 554 | { |
| 555 | .ident = MAC_MODEL_P575, |
| 556 | .name = "Performa 575", |
| 557 | .adb_type = MAC_ADB_CUDA, |
| 558 | .via_type = MAC_VIA_QUADRA, |
| 559 | .scsi_type = MAC_SCSI_QUADRA, |
| 560 | .scc_type = MAC_SCC_II, |
| 561 | .ether_type = MAC_ETHER_SONIC, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 562 | .nubus_type = MAC_NUBUS, |
| 563 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 564 | }, { |
| 565 | .ident = MAC_MODEL_P588, |
| 566 | .name = "Performa 588", |
| 567 | .adb_type = MAC_ADB_CUDA, |
| 568 | .via_type = MAC_VIA_QUADRA, |
| 569 | .scsi_type = MAC_SCSI_QUADRA, |
| 570 | .ide_type = MAC_IDE_QUADRA, |
| 571 | .scc_type = MAC_SCC_II, |
| 572 | .ether_type = MAC_ETHER_SONIC, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 573 | .nubus_type = MAC_NUBUS, |
| 574 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 575 | }, { |
| 576 | .ident = MAC_MODEL_TV, |
| 577 | .name = "TV", |
| 578 | .adb_type = MAC_ADB_CUDA, |
| 579 | .via_type = MAC_VIA_QUADRA, |
| 580 | .scsi_type = MAC_SCSI_OLD, |
| 581 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 582 | .nubus_type = MAC_NUBUS, |
| 583 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 584 | }, { |
| 585 | .ident = MAC_MODEL_P600, |
| 586 | .name = "Performa 600", |
| 587 | .adb_type = MAC_ADB_IISI, |
| 588 | .via_type = MAC_VIA_IIci, |
| 589 | .scsi_type = MAC_SCSI_OLD, |
| 590 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 591 | .nubus_type = MAC_NUBUS, |
| 592 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 593 | }, |
| 594 | |
| 595 | /* |
| 596 | * Centris - just guessing again; maybe like Quadra |
| 597 | */ |
| 598 | |
| 599 | /* The C610 may or may not have SONIC. We probe to make sure */ |
| 600 | { |
| 601 | .ident = MAC_MODEL_C610, |
| 602 | .name = "Centris 610", |
| 603 | .adb_type = MAC_ADB_II, |
| 604 | .via_type = MAC_VIA_QUADRA, |
| 605 | .scsi_type = MAC_SCSI_QUADRA, |
| 606 | .scc_type = MAC_SCC_QUADRA, |
| 607 | .ether_type = MAC_ETHER_SONIC, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 608 | .nubus_type = MAC_NUBUS, |
| 609 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 610 | }, { |
| 611 | .ident = MAC_MODEL_C650, |
| 612 | .name = "Centris 650", |
| 613 | .adb_type = MAC_ADB_II, |
| 614 | .via_type = MAC_VIA_QUADRA, |
| 615 | .scsi_type = MAC_SCSI_QUADRA, |
| 616 | .scc_type = MAC_SCC_QUADRA, |
| 617 | .ether_type = MAC_ETHER_SONIC, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 618 | .nubus_type = MAC_NUBUS, |
| 619 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 620 | }, { |
| 621 | .ident = MAC_MODEL_C660, |
| 622 | .name = "Centris 660AV", |
| 623 | .adb_type = MAC_ADB_CUDA, |
| 624 | .via_type = MAC_VIA_QUADRA, |
| 625 | .scsi_type = MAC_SCSI_QUADRA3, |
| 626 | .scc_type = MAC_SCC_PSC, |
| 627 | .ether_type = MAC_ETHER_MACE, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 628 | .nubus_type = MAC_NUBUS, |
| 629 | .floppy_type = MAC_FLOPPY_AV |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 630 | }, |
| 631 | |
| 632 | /* |
| 633 | * The PowerBooks all the same "Combo" custom IC for SCSI and SCC |
| 634 | * and a PMU (in two variations?) for ADB. Most of them use the |
| 635 | * Quadra-style VIAs. A few models also have IDE from hell. |
| 636 | */ |
| 637 | |
| 638 | { |
| 639 | .ident = MAC_MODEL_PB140, |
| 640 | .name = "PowerBook 140", |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 645 | .nubus_type = MAC_NUBUS, |
| 646 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 647 | }, { |
| 648 | .ident = MAC_MODEL_PB145, |
| 649 | .name = "PowerBook 145", |
| 650 | .adb_type = MAC_ADB_PB1, |
| 651 | .via_type = MAC_VIA_QUADRA, |
| 652 | .scsi_type = MAC_SCSI_OLD, |
| 653 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 654 | .nubus_type = MAC_NUBUS, |
| 655 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 656 | }, { |
| 657 | .ident = MAC_MODEL_PB150, |
| 658 | .name = "PowerBook 150", |
| 659 | .adb_type = MAC_ADB_PB1, |
| 660 | .via_type = MAC_VIA_IIci, |
| 661 | .scsi_type = MAC_SCSI_OLD, |
| 662 | .ide_type = MAC_IDE_PB, |
| 663 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 664 | .nubus_type = MAC_NUBUS, |
| 665 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 666 | }, { |
| 667 | .ident = MAC_MODEL_PB160, |
| 668 | .name = "PowerBook 160", |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 673 | .nubus_type = MAC_NUBUS, |
| 674 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 675 | }, { |
| 676 | .ident = MAC_MODEL_PB165, |
| 677 | .name = "PowerBook 165", |
| 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 Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 682 | .nubus_type = MAC_NUBUS, |
| 683 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 684 | }, { |
| 685 | .ident = MAC_MODEL_PB165C, |
| 686 | .name = "PowerBook 165c", |
| 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, |
| 692 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 693 | }, { |
| 694 | .ident = MAC_MODEL_PB170, |
| 695 | .name = "PowerBook 170", |
| 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, |
| 701 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 702 | }, { |
| 703 | .ident = MAC_MODEL_PB180, |
| 704 | .name = "PowerBook 180", |
| 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, |
| 710 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 711 | }, { |
| 712 | .ident = MAC_MODEL_PB180C, |
| 713 | .name = "PowerBook 180c", |
| 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, |
| 719 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 720 | }, { |
| 721 | .ident = MAC_MODEL_PB190, |
| 722 | .name = "PowerBook 190", |
| 723 | .adb_type = MAC_ADB_PB2, |
| 724 | .via_type = MAC_VIA_QUADRA, |
| 725 | .scsi_type = MAC_SCSI_OLD, |
| 726 | .ide_type = MAC_IDE_BABOON, |
| 727 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 728 | .nubus_type = MAC_NUBUS, |
| 729 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 730 | }, { |
| 731 | .ident = MAC_MODEL_PB520, |
| 732 | .name = "PowerBook 520", |
| 733 | .adb_type = MAC_ADB_PB2, |
| 734 | .via_type = MAC_VIA_QUADRA, |
| 735 | .scsi_type = MAC_SCSI_OLD, |
| 736 | .scc_type = MAC_SCC_QUADRA, |
| 737 | .ether_type = MAC_ETHER_SONIC, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 738 | .nubus_type = MAC_NUBUS, |
| 739 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 740 | }, |
| 741 | |
| 742 | /* |
| 743 | * PowerBook Duos are pretty much like normal PowerBooks |
| 744 | * All of these probably have onboard SONIC in the Dock which |
| 745 | * means we'll have to probe for it eventually. |
| 746 | * |
Simon Arlott | 0c79cf6 | 2007-10-20 01:20:32 +0200 | [diff] [blame] | 747 | * Are these really MAC_VIA_IIci? The developer notes for the |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 748 | * Duos show pretty much the same custom parts as in most of |
| 749 | * the other PowerBooks which would imply MAC_VIA_QUADRA. |
| 750 | */ |
| 751 | |
| 752 | { |
| 753 | .ident = MAC_MODEL_PB210, |
| 754 | .name = "PowerBook Duo 210", |
| 755 | .adb_type = MAC_ADB_PB2, |
| 756 | .via_type = MAC_VIA_IIci, |
| 757 | .scsi_type = MAC_SCSI_OLD, |
| 758 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 759 | .nubus_type = MAC_NUBUS, |
| 760 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 761 | }, { |
| 762 | .ident = MAC_MODEL_PB230, |
| 763 | .name = "PowerBook Duo 230", |
| 764 | .adb_type = MAC_ADB_PB2, |
| 765 | .via_type = MAC_VIA_IIci, |
| 766 | .scsi_type = MAC_SCSI_OLD, |
| 767 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 768 | .nubus_type = MAC_NUBUS, |
| 769 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 770 | }, { |
| 771 | .ident = MAC_MODEL_PB250, |
| 772 | .name = "PowerBook Duo 250", |
| 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, |
| 778 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 779 | }, { |
| 780 | .ident = MAC_MODEL_PB270C, |
| 781 | .name = "PowerBook Duo 270c", |
| 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, |
| 787 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 788 | }, { |
| 789 | .ident = MAC_MODEL_PB280, |
| 790 | .name = "PowerBook Duo 280", |
| 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, |
| 796 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 797 | }, { |
| 798 | .ident = MAC_MODEL_PB280C, |
| 799 | .name = "PowerBook Duo 280c", |
| 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, |
| 805 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 806 | }, |
| 807 | |
| 808 | /* |
| 809 | * Other stuff ?? |
| 810 | */ |
| 811 | { |
| 812 | .ident = -1 |
| 813 | } |
| 814 | }; |
| 815 | |
Adrian Bunk | 8dfbdf4 | 2008-07-17 21:16:25 +0200 | [diff] [blame] | 816 | static void __init mac_identify(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 817 | { |
| 818 | struct mac_model *m; |
| 819 | |
| 820 | /* Penguin data useful? */ |
| 821 | int model = mac_bi_data.id; |
| 822 | if (!model) { |
| 823 | /* no bootinfo model id -> NetBSD booter was used! */ |
| 824 | /* XXX FIXME: breaks for model > 31 */ |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 825 | model = (mac_bi_data.cpuid >> 2) & 63; |
| 826 | printk(KERN_WARNING "No bootinfo model ID, using cpuid instead (hey, use Penguin!)\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 827 | } |
| 828 | |
| 829 | macintosh_config = mac_data_table; |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 830 | for (m = macintosh_config; m->ident != -1; m++) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 831 | if (m->ident == model) { |
| 832 | macintosh_config = m; |
| 833 | break; |
| 834 | } |
| 835 | } |
| 836 | |
| 837 | /* We need to pre-init the IOPs, if any. Otherwise */ |
| 838 | /* the serial console won't work if the user had */ |
| 839 | /* the serial ports set to "Faster" mode in MacOS. */ |
| 840 | |
| 841 | iop_preinit(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 842 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 843 | printk(KERN_INFO "Detected Macintosh model: %d \n", model); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 844 | |
| 845 | /* |
| 846 | * Report booter data: |
| 847 | */ |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 848 | printk(KERN_DEBUG " Penguin bootinfo data:\n"); |
| 849 | printk(KERN_DEBUG " Video: addr 0x%lx row 0x%lx depth %lx dimensions %ld x %ld\n", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 850 | mac_bi_data.videoaddr, mac_bi_data.videorow, |
| 851 | mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF, |
| 852 | mac_bi_data.dimensions >> 16); |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 853 | 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] | 854 | mac_bi_data.videological, mac_orig_videoaddr, |
| 855 | mac_bi_data.sccbase); |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 856 | printk(KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx \n", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 857 | mac_bi_data.boottime, mac_bi_data.gmtbias); |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 858 | 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] | 859 | mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 860 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 861 | iop_init(); |
| 862 | via_init(); |
| 863 | oss_init(); |
| 864 | psc_init(); |
| 865 | baboon_init(); |
| 866 | } |
| 867 | |
Adrian Bunk | 8dfbdf4 | 2008-07-17 21:16:25 +0200 | [diff] [blame] | 868 | static void __init mac_report_hardware(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 869 | { |
| 870 | printk(KERN_INFO "Apple Macintosh %s\n", macintosh_config->name); |
| 871 | } |
| 872 | |
| 873 | static void mac_get_model(char *str) |
| 874 | { |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 875 | strcpy(str, "Macintosh "); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 876 | strcat(str, macintosh_config->name); |
| 877 | } |
Laurent Vivier | 8852ecd | 2008-11-15 16:10:10 +0100 | [diff] [blame] | 878 | |
| 879 | static struct resource swim_resources[1]; |
| 880 | |
| 881 | static struct platform_device swim_device = { |
| 882 | .name = "swim", |
| 883 | .id = -1, |
| 884 | .num_resources = ARRAY_SIZE(swim_resources), |
| 885 | .resource = swim_resources, |
| 886 | }; |
| 887 | |
| 888 | static struct platform_device *mac_platform_devices[] __initdata = { |
| 889 | &swim_device |
| 890 | }; |
| 891 | |
| 892 | int __init mac_platform_init(void) |
| 893 | { |
| 894 | u8 *swim_base; |
| 895 | |
| 896 | switch (macintosh_config->floppy_type) { |
| 897 | case MAC_FLOPPY_SWIM_ADDR1: |
| 898 | swim_base = (u8 *)(VIA1_BASE + 0x1E000); |
| 899 | break; |
| 900 | case MAC_FLOPPY_SWIM_ADDR2: |
| 901 | swim_base = (u8 *)(VIA1_BASE + 0x16000); |
| 902 | break; |
| 903 | default: |
| 904 | return 0; |
| 905 | } |
| 906 | |
| 907 | swim_resources[0].name = "swim-regs"; |
| 908 | swim_resources[0].start = (resource_size_t)swim_base; |
| 909 | swim_resources[0].end = (resource_size_t)(swim_base + SWIM_IO_SIZE); |
| 910 | swim_resources[0].flags = IORESOURCE_MEM; |
| 911 | |
| 912 | return platform_add_devices(mac_platform_devices, |
| 913 | ARRAY_SIZE(mac_platform_devices)); |
| 914 | } |
| 915 | |
| 916 | arch_initcall(mac_platform_init); |