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