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 | |
Al Viro | 66a3f82 | 2007-07-20 04:33:28 +0100 | [diff] [blame] | 74 | static void __init mac_sched_init(irq_handler_t vector) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 75 | { |
| 76 | via_init_clock(vector); |
| 77 | } |
| 78 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 79 | /* |
| 80 | * Parse a Macintosh-specific record in the bootinfo |
| 81 | */ |
| 82 | |
| 83 | int __init mac_parse_bootinfo(const struct bi_record *record) |
| 84 | { |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 85 | int unknown = 0; |
| 86 | const u_long *data = record->data; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 87 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 88 | switch (record->tag) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 89 | case BI_MAC_MODEL: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 90 | mac_bi_data.id = *data; |
| 91 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 92 | case BI_MAC_VADDR: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 93 | mac_bi_data.videoaddr = *data; |
| 94 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 95 | case BI_MAC_VDEPTH: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 96 | mac_bi_data.videodepth = *data; |
| 97 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 98 | case BI_MAC_VROW: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 99 | mac_bi_data.videorow = *data; |
| 100 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 101 | case BI_MAC_VDIM: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 102 | mac_bi_data.dimensions = *data; |
| 103 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 104 | case BI_MAC_VLOGICAL: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 105 | mac_bi_data.videological = VIDEOMEMBASE + (*data & ~VIDEOMEMMASK); |
| 106 | mac_orig_videoaddr = *data; |
| 107 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 108 | case BI_MAC_SCCBASE: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 109 | mac_bi_data.sccbase = *data; |
| 110 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 111 | case BI_MAC_BTIME: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 112 | mac_bi_data.boottime = *data; |
| 113 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 114 | case BI_MAC_GMTBIAS: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 115 | mac_bi_data.gmtbias = *data; |
| 116 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 117 | case BI_MAC_MEMSIZE: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 118 | mac_bi_data.memsize = *data; |
| 119 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 120 | case BI_MAC_CPUID: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 121 | mac_bi_data.cpuid = *data; |
| 122 | break; |
| 123 | case BI_MAC_ROMBASE: |
| 124 | mac_bi_data.rombase = *data; |
| 125 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 126 | default: |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 127 | unknown = 1; |
| 128 | break; |
| 129 | } |
| 130 | return unknown; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 131 | } |
| 132 | |
| 133 | /* |
| 134 | * Flip into 24bit mode for an instant - flushes the L2 cache card. We |
| 135 | * have to disable interrupts for this. Our IRQ handlers will crap |
| 136 | * themselves if they take an IRQ in 24bit mode! |
| 137 | */ |
| 138 | |
| 139 | static void mac_cache_card_flush(int writeback) |
| 140 | { |
| 141 | unsigned long flags; |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 142 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 143 | local_irq_save(flags); |
| 144 | via_flush_cache(); |
| 145 | local_irq_restore(flags); |
| 146 | } |
| 147 | |
| 148 | void __init config_mac(void) |
| 149 | { |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 150 | if (!MACH_IS_MAC) |
Frans Pop | b9b0d8b | 2010-02-06 18:47:11 +0100 | [diff] [blame] | 151 | printk(KERN_ERR "ERROR: no Mac, but config_mac() called!!\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 152 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 153 | mach_sched_init = mac_sched_init; |
| 154 | mach_init_IRQ = mac_init_IRQ; |
| 155 | mach_get_model = mac_get_model; |
| 156 | mach_gettimeoffset = mac_gettimeoffset; |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 157 | mach_hwclk = mac_hwclk; |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 158 | mach_set_clock_mmss = mac_set_clock_mmss; |
| 159 | mach_reset = mac_reset; |
| 160 | mach_halt = mac_poweroff; |
| 161 | mach_power_off = mac_poweroff; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 162 | mach_max_dma_address = 0xffffffff; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 163 | #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE) |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 164 | mach_beep = mac_mksound; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 165 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 166 | |
| 167 | /* |
| 168 | * Determine hardware present |
| 169 | */ |
| 170 | |
| 171 | mac_identify(); |
| 172 | mac_report_hardware(); |
| 173 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 174 | /* |
| 175 | * AFAIK only the IIci takes a cache card. The IIfx has onboard |
| 176 | * cache ... someone needs to figure out how to tell if it's on or |
| 177 | * not. |
| 178 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 179 | |
| 180 | if (macintosh_config->ident == MAC_MODEL_IICI |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 181 | || macintosh_config->ident == MAC_MODEL_IIFX) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 182 | mach_l2_flush = mac_cache_card_flush; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 183 | } |
| 184 | |
| 185 | |
| 186 | /* |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 187 | * Macintosh Table: hardcoded model configuration data. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 188 | * |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 189 | * Much of this was defined by Alan, based on who knows what docs. |
| 190 | * I've added a lot more, and some of that was pure guesswork based |
| 191 | * on hardware pages present on the Mac web site. Possibly wildly |
| 192 | * inaccurate, so look here if a new Mac model won't run. Example: if |
| 193 | * a Mac crashes immediately after the VIA1 registers have been dumped |
| 194 | * to the screen, it probably died attempting to read DirB on a RBV. |
| 195 | * Meaning it should have MAC_VIA_IIci here :-) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 196 | */ |
| 197 | |
| 198 | struct mac_model *macintosh_config; |
| 199 | EXPORT_SYMBOL(macintosh_config); |
| 200 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 201 | static struct mac_model mac_data_table[] = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 202 | /* |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 203 | * We'll pretend to be a Macintosh II, that's pretty safe. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 204 | */ |
| 205 | |
| 206 | { |
| 207 | .ident = MAC_MODEL_II, |
| 208 | .name = "Unknown", |
| 209 | .adb_type = MAC_ADB_II, |
| 210 | .via_type = MAC_VIA_II, |
| 211 | .scsi_type = MAC_SCSI_OLD, |
| 212 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 213 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 214 | .floppy_type = MAC_FLOPPY_IWM, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 215 | }, |
| 216 | |
| 217 | /* |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 218 | * Original Mac II hardware |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 219 | */ |
| 220 | |
| 221 | { |
| 222 | .ident = MAC_MODEL_II, |
| 223 | .name = "II", |
| 224 | .adb_type = MAC_ADB_II, |
| 225 | .via_type = MAC_VIA_II, |
| 226 | .scsi_type = MAC_SCSI_OLD, |
| 227 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 228 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 229 | .floppy_type = MAC_FLOPPY_IWM, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 230 | }, { |
| 231 | .ident = MAC_MODEL_IIX, |
| 232 | .name = "IIx", |
| 233 | .adb_type = MAC_ADB_II, |
| 234 | .via_type = MAC_VIA_II, |
| 235 | .scsi_type = MAC_SCSI_OLD, |
| 236 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 237 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 238 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 239 | }, { |
| 240 | .ident = MAC_MODEL_IICX, |
| 241 | .name = "IIcx", |
| 242 | .adb_type = MAC_ADB_II, |
| 243 | .via_type = MAC_VIA_II, |
| 244 | .scsi_type = MAC_SCSI_OLD, |
| 245 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 246 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 247 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 248 | }, { |
| 249 | .ident = MAC_MODEL_SE30, |
| 250 | .name = "SE/30", |
| 251 | .adb_type = MAC_ADB_II, |
| 252 | .via_type = MAC_VIA_II, |
| 253 | .scsi_type = MAC_SCSI_OLD, |
| 254 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 255 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 256 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 257 | }, |
| 258 | |
| 259 | /* |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 260 | * Weirdified Mac II hardware - all subtly different. Gee thanks |
| 261 | * Apple. All these boxes seem to have VIA2 in a different place to |
| 262 | * the Mac II (+1A000 rather than +4000) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 263 | * CSA: see http://developer.apple.com/technotes/hw/hw_09.html |
| 264 | */ |
| 265 | |
| 266 | { |
| 267 | .ident = MAC_MODEL_IICI, |
| 268 | .name = "IIci", |
| 269 | .adb_type = MAC_ADB_II, |
| 270 | .via_type = MAC_VIA_IIci, |
| 271 | .scsi_type = MAC_SCSI_OLD, |
| 272 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 273 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 274 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 275 | }, { |
| 276 | .ident = MAC_MODEL_IIFX, |
| 277 | .name = "IIfx", |
| 278 | .adb_type = MAC_ADB_IOP, |
| 279 | .via_type = MAC_VIA_IIci, |
| 280 | .scsi_type = MAC_SCSI_OLD, |
| 281 | .scc_type = MAC_SCC_IOP, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 282 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 283 | .floppy_type = MAC_FLOPPY_SWIM_IOP, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 284 | }, { |
| 285 | .ident = MAC_MODEL_IISI, |
| 286 | .name = "IIsi", |
| 287 | .adb_type = MAC_ADB_IISI, |
| 288 | .via_type = MAC_VIA_IIci, |
| 289 | .scsi_type = MAC_SCSI_OLD, |
| 290 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 291 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 292 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 293 | }, { |
| 294 | .ident = MAC_MODEL_IIVI, |
| 295 | .name = "IIvi", |
| 296 | .adb_type = MAC_ADB_IISI, |
| 297 | .via_type = MAC_VIA_IIci, |
| 298 | .scsi_type = MAC_SCSI_OLD, |
| 299 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 300 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 301 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 302 | }, { |
| 303 | .ident = MAC_MODEL_IIVX, |
| 304 | .name = "IIvx", |
| 305 | .adb_type = MAC_ADB_IISI, |
| 306 | .via_type = MAC_VIA_IIci, |
| 307 | .scsi_type = MAC_SCSI_OLD, |
| 308 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 309 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 310 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 311 | }, |
| 312 | |
| 313 | /* |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 314 | * Classic models (guessing: similar to SE/30? Nope, similar to LC...) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 315 | */ |
| 316 | |
| 317 | { |
| 318 | .ident = MAC_MODEL_CLII, |
| 319 | .name = "Classic II", |
| 320 | .adb_type = MAC_ADB_IISI, |
| 321 | .via_type = MAC_VIA_IIci, |
| 322 | .scsi_type = MAC_SCSI_OLD, |
| 323 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 324 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 325 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 326 | }, { |
| 327 | .ident = MAC_MODEL_CCL, |
| 328 | .name = "Color Classic", |
| 329 | .adb_type = MAC_ADB_CUDA, |
| 330 | .via_type = MAC_VIA_IIci, |
| 331 | .scsi_type = MAC_SCSI_OLD, |
| 332 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 333 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 334 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Finn Thain | 1b46010 | 2010-05-29 03:27:18 +1000 | [diff] [blame^] | 335 | }, { |
| 336 | .ident = MAC_MODEL_CCLII, |
| 337 | .name = "Color Classic II", |
| 338 | .adb_type = MAC_ADB_CUDA, |
| 339 | .via_type = MAC_VIA_IIci, |
| 340 | .scsi_type = MAC_SCSI_OLD, |
| 341 | .scc_type = MAC_SCC_II, |
| 342 | .nubus_type = MAC_NUBUS, |
| 343 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 344 | }, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 345 | |
| 346 | /* |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 347 | * 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] | 348 | */ |
| 349 | |
| 350 | { |
| 351 | .ident = MAC_MODEL_LC, |
| 352 | .name = "LC", |
| 353 | .adb_type = MAC_ADB_IISI, |
| 354 | .via_type = MAC_VIA_IIci, |
| 355 | .scsi_type = MAC_SCSI_OLD, |
| 356 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 357 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 358 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 359 | }, { |
| 360 | .ident = MAC_MODEL_LCII, |
| 361 | .name = "LC II", |
| 362 | .adb_type = MAC_ADB_IISI, |
| 363 | .via_type = MAC_VIA_IIci, |
| 364 | .scsi_type = MAC_SCSI_OLD, |
| 365 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 366 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 367 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 368 | }, { |
| 369 | .ident = MAC_MODEL_LCIII, |
| 370 | .name = "LC III", |
| 371 | .adb_type = MAC_ADB_IISI, |
| 372 | .via_type = MAC_VIA_IIci, |
| 373 | .scsi_type = MAC_SCSI_OLD, |
| 374 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 375 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 376 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 377 | }, |
| 378 | |
| 379 | /* |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 380 | * Quadra. Video is at 0xF9000000, via is like a MacII. We label it |
| 381 | * differently as some of the stuff connected to VIA2 seems different. |
| 382 | * Better SCSI chip and onboard ethernet using a NatSemi SONIC except |
| 383 | * the 660AV and 840AV which use an AMD 79C940 (MACE). |
| 384 | * The 700, 900 and 950 have some I/O chips in the wrong place to |
| 385 | * confuse us. The 840AV has a SCSI location of its own (same as |
| 386 | * the 660AV). |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 387 | */ |
| 388 | |
| 389 | { |
| 390 | .ident = MAC_MODEL_Q605, |
| 391 | .name = "Quadra 605", |
| 392 | .adb_type = MAC_ADB_CUDA, |
| 393 | .via_type = MAC_VIA_QUADRA, |
| 394 | .scsi_type = MAC_SCSI_QUADRA, |
| 395 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 396 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 397 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 398 | }, { |
| 399 | .ident = MAC_MODEL_Q605_ACC, |
| 400 | .name = "Quadra 605", |
| 401 | .adb_type = MAC_ADB_CUDA, |
| 402 | .via_type = MAC_VIA_QUADRA, |
| 403 | .scsi_type = MAC_SCSI_QUADRA, |
| 404 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 405 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 406 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 407 | }, { |
| 408 | .ident = MAC_MODEL_Q610, |
| 409 | .name = "Quadra 610", |
| 410 | .adb_type = MAC_ADB_II, |
| 411 | .via_type = MAC_VIA_QUADRA, |
| 412 | .scsi_type = MAC_SCSI_QUADRA, |
| 413 | .scc_type = MAC_SCC_QUADRA, |
| 414 | .ether_type = MAC_ETHER_SONIC, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 415 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 416 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 417 | }, { |
| 418 | .ident = MAC_MODEL_Q630, |
| 419 | .name = "Quadra 630", |
| 420 | .adb_type = MAC_ADB_CUDA, |
| 421 | .via_type = MAC_VIA_QUADRA, |
| 422 | .scsi_type = MAC_SCSI_QUADRA, |
| 423 | .ide_type = MAC_IDE_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, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 427 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 428 | }, { |
| 429 | .ident = MAC_MODEL_Q650, |
| 430 | .name = "Quadra 650", |
| 431 | .adb_type = MAC_ADB_II, |
| 432 | .via_type = MAC_VIA_QUADRA, |
| 433 | .scsi_type = MAC_SCSI_QUADRA, |
| 434 | .scc_type = MAC_SCC_QUADRA, |
| 435 | .ether_type = MAC_ETHER_SONIC, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 436 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 437 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 438 | }, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 439 | /* The Q700 does have a NS Sonic */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 440 | { |
| 441 | .ident = MAC_MODEL_Q700, |
| 442 | .name = "Quadra 700", |
| 443 | .adb_type = MAC_ADB_II, |
| 444 | .via_type = MAC_VIA_QUADRA, |
| 445 | .scsi_type = MAC_SCSI_QUADRA2, |
| 446 | .scc_type = MAC_SCC_QUADRA, |
| 447 | .ether_type = MAC_ETHER_SONIC, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 448 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 449 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 450 | }, { |
| 451 | .ident = MAC_MODEL_Q800, |
| 452 | .name = "Quadra 800", |
| 453 | .adb_type = MAC_ADB_II, |
| 454 | .via_type = MAC_VIA_QUADRA, |
| 455 | .scsi_type = MAC_SCSI_QUADRA, |
| 456 | .scc_type = MAC_SCC_QUADRA, |
| 457 | .ether_type = MAC_ETHER_SONIC, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 458 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 459 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 460 | }, { |
| 461 | .ident = MAC_MODEL_Q840, |
| 462 | .name = "Quadra 840AV", |
| 463 | .adb_type = MAC_ADB_CUDA, |
| 464 | .via_type = MAC_VIA_QUADRA, |
| 465 | .scsi_type = MAC_SCSI_QUADRA3, |
| 466 | .scc_type = MAC_SCC_PSC, |
| 467 | .ether_type = MAC_ETHER_MACE, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 468 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 469 | .floppy_type = MAC_FLOPPY_AV, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 470 | }, { |
| 471 | .ident = MAC_MODEL_Q900, |
| 472 | .name = "Quadra 900", |
| 473 | .adb_type = MAC_ADB_IOP, |
| 474 | .via_type = MAC_VIA_QUADRA, |
| 475 | .scsi_type = MAC_SCSI_QUADRA2, |
| 476 | .scc_type = MAC_SCC_IOP, |
| 477 | .ether_type = MAC_ETHER_SONIC, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 478 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 479 | .floppy_type = MAC_FLOPPY_SWIM_IOP, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 480 | }, { |
| 481 | .ident = MAC_MODEL_Q950, |
| 482 | .name = "Quadra 950", |
| 483 | .adb_type = MAC_ADB_IOP, |
| 484 | .via_type = MAC_VIA_QUADRA, |
| 485 | .scsi_type = MAC_SCSI_QUADRA2, |
| 486 | .scc_type = MAC_SCC_IOP, |
| 487 | .ether_type = MAC_ETHER_SONIC, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 488 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 489 | .floppy_type = MAC_FLOPPY_SWIM_IOP, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 490 | }, |
| 491 | |
| 492 | /* |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 493 | * Performa - more LC type machines |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 494 | */ |
| 495 | |
| 496 | { |
| 497 | .ident = MAC_MODEL_P460, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 498 | .name = "Performa 460", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 499 | .adb_type = MAC_ADB_IISI, |
| 500 | .via_type = MAC_VIA_IIci, |
| 501 | .scsi_type = MAC_SCSI_OLD, |
| 502 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 503 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 504 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 505 | }, { |
| 506 | .ident = MAC_MODEL_P475, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 507 | .name = "Performa 475", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 508 | .adb_type = MAC_ADB_CUDA, |
| 509 | .via_type = MAC_VIA_QUADRA, |
| 510 | .scsi_type = MAC_SCSI_QUADRA, |
| 511 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 512 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 513 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 514 | }, { |
| 515 | .ident = MAC_MODEL_P475F, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 516 | .name = "Performa 475", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 517 | .adb_type = MAC_ADB_CUDA, |
| 518 | .via_type = MAC_VIA_QUADRA, |
| 519 | .scsi_type = MAC_SCSI_QUADRA, |
| 520 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 521 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 522 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 523 | }, { |
| 524 | .ident = MAC_MODEL_P520, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 525 | .name = "Performa 520", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 526 | .adb_type = MAC_ADB_CUDA, |
| 527 | .via_type = MAC_VIA_IIci, |
| 528 | .scsi_type = MAC_SCSI_OLD, |
| 529 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 530 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 531 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 532 | }, { |
| 533 | .ident = MAC_MODEL_P550, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 534 | .name = "Performa 550", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 535 | .adb_type = MAC_ADB_CUDA, |
| 536 | .via_type = MAC_VIA_IIci, |
| 537 | .scsi_type = MAC_SCSI_OLD, |
| 538 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 539 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 540 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 541 | }, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 542 | /* These have the comm slot, and therefore possibly SONIC ethernet */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 543 | { |
| 544 | .ident = MAC_MODEL_P575, |
| 545 | .name = "Performa 575", |
| 546 | .adb_type = MAC_ADB_CUDA, |
| 547 | .via_type = MAC_VIA_QUADRA, |
| 548 | .scsi_type = MAC_SCSI_QUADRA, |
| 549 | .scc_type = MAC_SCC_II, |
| 550 | .ether_type = MAC_ETHER_SONIC, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 551 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 552 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 553 | }, { |
| 554 | .ident = MAC_MODEL_P588, |
| 555 | .name = "Performa 588", |
| 556 | .adb_type = MAC_ADB_CUDA, |
| 557 | .via_type = MAC_VIA_QUADRA, |
| 558 | .scsi_type = MAC_SCSI_QUADRA, |
| 559 | .ide_type = MAC_IDE_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, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 563 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 564 | }, { |
| 565 | .ident = MAC_MODEL_TV, |
| 566 | .name = "TV", |
| 567 | .adb_type = MAC_ADB_CUDA, |
| 568 | .via_type = MAC_VIA_QUADRA, |
| 569 | .scsi_type = MAC_SCSI_OLD, |
| 570 | .scc_type = MAC_SCC_II, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 571 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 572 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 573 | }, { |
| 574 | .ident = MAC_MODEL_P600, |
| 575 | .name = "Performa 600", |
| 576 | .adb_type = MAC_ADB_IISI, |
| 577 | .via_type = MAC_VIA_IIci, |
| 578 | .scsi_type = MAC_SCSI_OLD, |
| 579 | .scc_type = MAC_SCC_II, |
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_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 582 | }, |
| 583 | |
| 584 | /* |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 585 | * Centris - just guessing again; maybe like Quadra. |
| 586 | * 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] | 587 | */ |
| 588 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 589 | { |
| 590 | .ident = MAC_MODEL_C610, |
| 591 | .name = "Centris 610", |
| 592 | .adb_type = MAC_ADB_II, |
| 593 | .via_type = MAC_VIA_QUADRA, |
| 594 | .scsi_type = MAC_SCSI_QUADRA, |
| 595 | .scc_type = MAC_SCC_QUADRA, |
| 596 | .ether_type = MAC_ETHER_SONIC, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 597 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 598 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 599 | }, { |
| 600 | .ident = MAC_MODEL_C650, |
| 601 | .name = "Centris 650", |
| 602 | .adb_type = MAC_ADB_II, |
| 603 | .via_type = MAC_VIA_QUADRA, |
| 604 | .scsi_type = MAC_SCSI_QUADRA, |
| 605 | .scc_type = MAC_SCC_QUADRA, |
| 606 | .ether_type = MAC_ETHER_SONIC, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 607 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 608 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 609 | }, { |
| 610 | .ident = MAC_MODEL_C660, |
| 611 | .name = "Centris 660AV", |
| 612 | .adb_type = MAC_ADB_CUDA, |
| 613 | .via_type = MAC_VIA_QUADRA, |
| 614 | .scsi_type = MAC_SCSI_QUADRA3, |
| 615 | .scc_type = MAC_SCC_PSC, |
| 616 | .ether_type = MAC_ETHER_MACE, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 617 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 618 | .floppy_type = MAC_FLOPPY_AV, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 619 | }, |
| 620 | |
| 621 | /* |
| 622 | * The PowerBooks all the same "Combo" custom IC for SCSI and SCC |
| 623 | * and a PMU (in two variations?) for ADB. Most of them use the |
| 624 | * Quadra-style VIAs. A few models also have IDE from hell. |
| 625 | */ |
| 626 | |
| 627 | { |
| 628 | .ident = MAC_MODEL_PB140, |
| 629 | .name = "PowerBook 140", |
| 630 | .adb_type = MAC_ADB_PB1, |
| 631 | .via_type = MAC_VIA_QUADRA, |
| 632 | .scsi_type = MAC_SCSI_OLD, |
| 633 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 634 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 635 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 636 | }, { |
| 637 | .ident = MAC_MODEL_PB145, |
| 638 | .name = "PowerBook 145", |
| 639 | .adb_type = MAC_ADB_PB1, |
| 640 | .via_type = MAC_VIA_QUADRA, |
| 641 | .scsi_type = MAC_SCSI_OLD, |
| 642 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 643 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 644 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 645 | }, { |
| 646 | .ident = MAC_MODEL_PB150, |
| 647 | .name = "PowerBook 150", |
| 648 | .adb_type = MAC_ADB_PB1, |
| 649 | .via_type = MAC_VIA_IIci, |
| 650 | .scsi_type = MAC_SCSI_OLD, |
| 651 | .ide_type = MAC_IDE_PB, |
| 652 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 653 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 654 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 655 | }, { |
| 656 | .ident = MAC_MODEL_PB160, |
| 657 | .name = "PowerBook 160", |
| 658 | .adb_type = MAC_ADB_PB1, |
| 659 | .via_type = MAC_VIA_QUADRA, |
| 660 | .scsi_type = MAC_SCSI_OLD, |
| 661 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 662 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 663 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 664 | }, { |
| 665 | .ident = MAC_MODEL_PB165, |
| 666 | .name = "PowerBook 165", |
| 667 | .adb_type = MAC_ADB_PB1, |
| 668 | .via_type = MAC_VIA_QUADRA, |
| 669 | .scsi_type = MAC_SCSI_OLD, |
| 670 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 671 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 672 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 673 | }, { |
| 674 | .ident = MAC_MODEL_PB165C, |
| 675 | .name = "PowerBook 165c", |
| 676 | .adb_type = MAC_ADB_PB1, |
| 677 | .via_type = MAC_VIA_QUADRA, |
| 678 | .scsi_type = MAC_SCSI_OLD, |
| 679 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 680 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 681 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 682 | }, { |
| 683 | .ident = MAC_MODEL_PB170, |
| 684 | .name = "PowerBook 170", |
| 685 | .adb_type = MAC_ADB_PB1, |
| 686 | .via_type = MAC_VIA_QUADRA, |
| 687 | .scsi_type = MAC_SCSI_OLD, |
| 688 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 689 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 690 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 691 | }, { |
| 692 | .ident = MAC_MODEL_PB180, |
| 693 | .name = "PowerBook 180", |
| 694 | .adb_type = MAC_ADB_PB1, |
| 695 | .via_type = MAC_VIA_QUADRA, |
| 696 | .scsi_type = MAC_SCSI_OLD, |
| 697 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 698 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 699 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 700 | }, { |
| 701 | .ident = MAC_MODEL_PB180C, |
| 702 | .name = "PowerBook 180c", |
| 703 | .adb_type = MAC_ADB_PB1, |
| 704 | .via_type = MAC_VIA_QUADRA, |
| 705 | .scsi_type = MAC_SCSI_OLD, |
| 706 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 707 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 708 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 709 | }, { |
| 710 | .ident = MAC_MODEL_PB190, |
| 711 | .name = "PowerBook 190", |
| 712 | .adb_type = MAC_ADB_PB2, |
| 713 | .via_type = MAC_VIA_QUADRA, |
| 714 | .scsi_type = MAC_SCSI_OLD, |
| 715 | .ide_type = MAC_IDE_BABOON, |
| 716 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 717 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 718 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 719 | }, { |
| 720 | .ident = MAC_MODEL_PB520, |
| 721 | .name = "PowerBook 520", |
| 722 | .adb_type = MAC_ADB_PB2, |
| 723 | .via_type = MAC_VIA_QUADRA, |
| 724 | .scsi_type = MAC_SCSI_OLD, |
| 725 | .scc_type = MAC_SCC_QUADRA, |
| 726 | .ether_type = MAC_ETHER_SONIC, |
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 | |
| 731 | /* |
| 732 | * PowerBook Duos are pretty much like normal PowerBooks |
| 733 | * All of these probably have onboard SONIC in the Dock which |
| 734 | * means we'll have to probe for it eventually. |
| 735 | * |
Simon Arlott | 0c79cf6 | 2007-10-20 01:20:32 +0200 | [diff] [blame] | 736 | * Are these really MAC_VIA_IIci? The developer notes for the |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 737 | * Duos show pretty much the same custom parts as in most of |
| 738 | * the other PowerBooks which would imply MAC_VIA_QUADRA. |
| 739 | */ |
| 740 | |
| 741 | { |
| 742 | .ident = MAC_MODEL_PB210, |
| 743 | .name = "PowerBook Duo 210", |
| 744 | .adb_type = MAC_ADB_PB2, |
| 745 | .via_type = MAC_VIA_IIci, |
| 746 | .scsi_type = MAC_SCSI_OLD, |
| 747 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 748 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 749 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 750 | }, { |
| 751 | .ident = MAC_MODEL_PB230, |
| 752 | .name = "PowerBook Duo 230", |
| 753 | .adb_type = MAC_ADB_PB2, |
| 754 | .via_type = MAC_VIA_IIci, |
| 755 | .scsi_type = MAC_SCSI_OLD, |
| 756 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 757 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 758 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 759 | }, { |
| 760 | .ident = MAC_MODEL_PB250, |
| 761 | .name = "PowerBook Duo 250", |
| 762 | .adb_type = MAC_ADB_PB2, |
| 763 | .via_type = MAC_VIA_IIci, |
| 764 | .scsi_type = MAC_SCSI_OLD, |
| 765 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 766 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 767 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 768 | }, { |
| 769 | .ident = MAC_MODEL_PB270C, |
| 770 | .name = "PowerBook Duo 270c", |
| 771 | .adb_type = MAC_ADB_PB2, |
| 772 | .via_type = MAC_VIA_IIci, |
| 773 | .scsi_type = MAC_SCSI_OLD, |
| 774 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 775 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 776 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 777 | }, { |
| 778 | .ident = MAC_MODEL_PB280, |
| 779 | .name = "PowerBook Duo 280", |
| 780 | .adb_type = MAC_ADB_PB2, |
| 781 | .via_type = MAC_VIA_IIci, |
| 782 | .scsi_type = MAC_SCSI_OLD, |
| 783 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 784 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 785 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 786 | }, { |
| 787 | .ident = MAC_MODEL_PB280C, |
| 788 | .name = "PowerBook Duo 280c", |
| 789 | .adb_type = MAC_ADB_PB2, |
| 790 | .via_type = MAC_VIA_IIci, |
| 791 | .scsi_type = MAC_SCSI_OLD, |
| 792 | .scc_type = MAC_SCC_QUADRA, |
Laurent Vivier | 7ad93b4 | 2008-11-06 20:57:41 +0100 | [diff] [blame] | 793 | .nubus_type = MAC_NUBUS, |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 794 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 795 | }, |
| 796 | |
| 797 | /* |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 798 | * Other stuff? |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 799 | */ |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 800 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 801 | { |
| 802 | .ident = -1 |
| 803 | } |
| 804 | }; |
| 805 | |
Finn Thain | 80614e5 | 2009-11-17 20:06:48 +1100 | [diff] [blame] | 806 | static struct resource scc_a_rsrcs[] = { |
| 807 | { .flags = IORESOURCE_MEM }, |
| 808 | { .flags = IORESOURCE_IRQ }, |
| 809 | }; |
| 810 | |
| 811 | static struct resource scc_b_rsrcs[] = { |
| 812 | { .flags = IORESOURCE_MEM }, |
| 813 | { .flags = IORESOURCE_IRQ }, |
| 814 | }; |
| 815 | |
| 816 | struct platform_device scc_a_pdev = { |
| 817 | .name = "scc", |
| 818 | .id = 0, |
| 819 | .num_resources = ARRAY_SIZE(scc_a_rsrcs), |
| 820 | .resource = scc_a_rsrcs, |
| 821 | }; |
| 822 | EXPORT_SYMBOL(scc_a_pdev); |
| 823 | |
| 824 | struct platform_device scc_b_pdev = { |
| 825 | .name = "scc", |
| 826 | .id = 1, |
| 827 | .num_resources = ARRAY_SIZE(scc_b_rsrcs), |
| 828 | .resource = scc_b_rsrcs, |
| 829 | }; |
| 830 | EXPORT_SYMBOL(scc_b_pdev); |
| 831 | |
Adrian Bunk | 8dfbdf4 | 2008-07-17 21:16:25 +0200 | [diff] [blame] | 832 | static void __init mac_identify(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 833 | { |
| 834 | struct mac_model *m; |
| 835 | |
| 836 | /* Penguin data useful? */ |
| 837 | int model = mac_bi_data.id; |
| 838 | if (!model) { |
| 839 | /* no bootinfo model id -> NetBSD booter was used! */ |
| 840 | /* XXX FIXME: breaks for model > 31 */ |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 841 | model = (mac_bi_data.cpuid >> 2) & 63; |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 842 | printk(KERN_WARNING "No bootinfo model ID, using cpuid instead " |
| 843 | "(obsolete bootloader?)\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 844 | } |
| 845 | |
| 846 | macintosh_config = mac_data_table; |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 847 | for (m = macintosh_config; m->ident != -1; m++) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 848 | if (m->ident == model) { |
| 849 | macintosh_config = m; |
| 850 | break; |
| 851 | } |
| 852 | } |
| 853 | |
Finn Thain | 80614e5 | 2009-11-17 20:06:48 +1100 | [diff] [blame] | 854 | /* Set up serial port resources for the console initcall. */ |
| 855 | |
| 856 | scc_a_rsrcs[0].start = (resource_size_t) mac_bi_data.sccbase + 2; |
| 857 | scc_a_rsrcs[0].end = scc_a_rsrcs[0].start; |
| 858 | scc_b_rsrcs[0].start = (resource_size_t) mac_bi_data.sccbase; |
| 859 | scc_b_rsrcs[0].end = scc_b_rsrcs[0].start; |
| 860 | |
| 861 | switch (macintosh_config->scc_type) { |
| 862 | case MAC_SCC_PSC: |
| 863 | scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC_A; |
| 864 | scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC_B; |
| 865 | break; |
| 866 | default: |
| 867 | scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC; |
| 868 | scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC; |
| 869 | break; |
| 870 | } |
| 871 | |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 872 | /* |
| 873 | * We need to pre-init the IOPs, if any. Otherwise |
| 874 | * the serial console won't work if the user had |
| 875 | * the serial ports set to "Faster" mode in MacOS. |
| 876 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 877 | iop_preinit(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 878 | |
Frans Pop | b9b0d8b | 2010-02-06 18:47:11 +0100 | [diff] [blame] | 879 | printk(KERN_INFO "Detected Macintosh model: %d\n", model); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 880 | |
| 881 | /* |
| 882 | * Report booter data: |
| 883 | */ |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 884 | printk(KERN_DEBUG " Penguin bootinfo data:\n"); |
Finn Thain | 53aac0a | 2009-11-04 00:39:09 +1100 | [diff] [blame] | 885 | printk(KERN_DEBUG " Video: addr 0x%lx " |
| 886 | "row 0x%lx depth %lx dimensions %ld x %ld\n", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 887 | mac_bi_data.videoaddr, mac_bi_data.videorow, |
| 888 | mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF, |
| 889 | mac_bi_data.dimensions >> 16); |
Frans Pop | b9b0d8b | 2010-02-06 18:47:11 +0100 | [diff] [blame] | 890 | 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] | 891 | mac_bi_data.videological, mac_orig_videoaddr, |
| 892 | mac_bi_data.sccbase); |
Frans Pop | b9b0d8b | 2010-02-06 18:47:11 +0100 | [diff] [blame] | 893 | printk(KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx\n", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 894 | mac_bi_data.boottime, mac_bi_data.gmtbias); |
Frans Pop | b9b0d8b | 2010-02-06 18:47:11 +0100 | [diff] [blame] | 895 | 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] | 896 | mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 897 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 898 | iop_init(); |
| 899 | via_init(); |
| 900 | oss_init(); |
| 901 | psc_init(); |
| 902 | baboon_init(); |
Finn Thain | 18814ee | 2009-11-17 20:03:05 +1100 | [diff] [blame] | 903 | |
| 904 | #ifdef CONFIG_ADB_CUDA |
| 905 | find_via_cuda(); |
| 906 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 907 | } |
| 908 | |
Adrian Bunk | 8dfbdf4 | 2008-07-17 21:16:25 +0200 | [diff] [blame] | 909 | static void __init mac_report_hardware(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 910 | { |
| 911 | printk(KERN_INFO "Apple Macintosh %s\n", macintosh_config->name); |
| 912 | } |
| 913 | |
| 914 | static void mac_get_model(char *str) |
| 915 | { |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame] | 916 | strcpy(str, "Macintosh "); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 917 | strcat(str, macintosh_config->name); |
| 918 | } |
Laurent Vivier | 8852ecd | 2008-11-15 16:10:10 +0100 | [diff] [blame] | 919 | |
Finn Thain | 2724daf | 2009-11-04 00:39:56 +1100 | [diff] [blame] | 920 | static struct resource swim_rsrc = { .flags = IORESOURCE_MEM }; |
Laurent Vivier | 8852ecd | 2008-11-15 16:10:10 +0100 | [diff] [blame] | 921 | |
Finn Thain | 2724daf | 2009-11-04 00:39:56 +1100 | [diff] [blame] | 922 | static struct platform_device swim_pdev = { |
Laurent Vivier | 8852ecd | 2008-11-15 16:10:10 +0100 | [diff] [blame] | 923 | .name = "swim", |
| 924 | .id = -1, |
Finn Thain | 2724daf | 2009-11-04 00:39:56 +1100 | [diff] [blame] | 925 | .num_resources = 1, |
| 926 | .resource = &swim_rsrc, |
Laurent Vivier | 8852ecd | 2008-11-15 16:10:10 +0100 | [diff] [blame] | 927 | }; |
| 928 | |
Finn Thain | cff75f1 | 2009-11-04 00:41:35 +1100 | [diff] [blame] | 929 | static struct platform_device esp_0_pdev = { |
| 930 | .name = "mac_esp", |
| 931 | .id = 0, |
| 932 | }; |
| 933 | |
| 934 | static struct platform_device esp_1_pdev = { |
| 935 | .name = "mac_esp", |
| 936 | .id = 1, |
| 937 | }; |
| 938 | |
Finn Thain | eeb9c18 | 2009-11-04 00:42:02 +1100 | [diff] [blame] | 939 | static struct platform_device sonic_pdev = { |
| 940 | .name = "macsonic", |
| 941 | .id = -1, |
| 942 | }; |
| 943 | |
| 944 | static struct platform_device mace_pdev = { |
| 945 | .name = "macmace", |
| 946 | .id = -1, |
| 947 | }; |
| 948 | |
Laurent Vivier | 8852ecd | 2008-11-15 16:10:10 +0100 | [diff] [blame] | 949 | int __init mac_platform_init(void) |
| 950 | { |
| 951 | u8 *swim_base; |
| 952 | |
Finn Thain | 2724daf | 2009-11-04 00:39:56 +1100 | [diff] [blame] | 953 | /* |
Finn Thain | 80614e5 | 2009-11-17 20:06:48 +1100 | [diff] [blame] | 954 | * Serial devices |
| 955 | */ |
| 956 | |
| 957 | platform_device_register(&scc_a_pdev); |
| 958 | platform_device_register(&scc_b_pdev); |
| 959 | |
| 960 | /* |
Finn Thain | 2724daf | 2009-11-04 00:39:56 +1100 | [diff] [blame] | 961 | * Floppy device |
| 962 | */ |
| 963 | |
Laurent Vivier | 8852ecd | 2008-11-15 16:10:10 +0100 | [diff] [blame] | 964 | switch (macintosh_config->floppy_type) { |
| 965 | case MAC_FLOPPY_SWIM_ADDR1: |
| 966 | swim_base = (u8 *)(VIA1_BASE + 0x1E000); |
| 967 | break; |
| 968 | case MAC_FLOPPY_SWIM_ADDR2: |
| 969 | swim_base = (u8 *)(VIA1_BASE + 0x16000); |
| 970 | break; |
| 971 | default: |
Finn Thain | 2724daf | 2009-11-04 00:39:56 +1100 | [diff] [blame] | 972 | swim_base = NULL; |
| 973 | break; |
Laurent Vivier | 8852ecd | 2008-11-15 16:10:10 +0100 | [diff] [blame] | 974 | } |
| 975 | |
Finn Thain | 2724daf | 2009-11-04 00:39:56 +1100 | [diff] [blame] | 976 | if (swim_base) { |
| 977 | swim_rsrc.start = (resource_size_t) swim_base, |
| 978 | swim_rsrc.end = (resource_size_t) swim_base + 0x2000, |
| 979 | platform_device_register(&swim_pdev); |
| 980 | } |
Laurent Vivier | 8852ecd | 2008-11-15 16:10:10 +0100 | [diff] [blame] | 981 | |
Finn Thain | cff75f1 | 2009-11-04 00:41:35 +1100 | [diff] [blame] | 982 | /* |
| 983 | * SCSI device(s) |
| 984 | */ |
| 985 | |
| 986 | switch (macintosh_config->scsi_type) { |
| 987 | case MAC_SCSI_QUADRA: |
| 988 | case MAC_SCSI_QUADRA3: |
| 989 | platform_device_register(&esp_0_pdev); |
| 990 | break; |
| 991 | case MAC_SCSI_QUADRA2: |
| 992 | platform_device_register(&esp_0_pdev); |
| 993 | if ((macintosh_config->ident == MAC_MODEL_Q900) || |
| 994 | (macintosh_config->ident == MAC_MODEL_Q950)) |
| 995 | platform_device_register(&esp_1_pdev); |
| 996 | break; |
| 997 | } |
| 998 | |
Finn Thain | eeb9c18 | 2009-11-04 00:42:02 +1100 | [diff] [blame] | 999 | /* |
| 1000 | * Ethernet device |
| 1001 | */ |
| 1002 | |
| 1003 | switch (macintosh_config->ether_type) { |
| 1004 | case MAC_ETHER_SONIC: |
| 1005 | platform_device_register(&sonic_pdev); |
| 1006 | break; |
| 1007 | case MAC_ETHER_MACE: |
| 1008 | platform_device_register(&mace_pdev); |
| 1009 | break; |
| 1010 | } |
| 1011 | |
Finn Thain | 2724daf | 2009-11-04 00:39:56 +1100 | [diff] [blame] | 1012 | return 0; |
Laurent Vivier | 8852ecd | 2008-11-15 16:10:10 +0100 | [diff] [blame] | 1013 | } |
| 1014 | |
| 1015 | arch_initcall(mac_platform_init); |