aboutsummaryrefslogtreecommitdiff
path: root/arch/m68k/mac
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 15:20:36 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 15:20:36 -0700
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/m68k/mac
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'arch/m68k/mac')
-rw-r--r--arch/m68k/mac/Makefile6
-rw-r--r--arch/m68k/mac/baboon.c126
-rw-r--r--arch/m68k/mac/bootparse.c122
-rw-r--r--arch/m68k/mac/config.c902
-rw-r--r--arch/m68k/mac/debug.c398
-rw-r--r--arch/m68k/mac/iop.c714
-rw-r--r--arch/m68k/mac/mac_ksyms.c8
-rw-r--r--arch/m68k/mac/mac_penguin.S75
-rw-r--r--arch/m68k/mac/macboing.c309
-rw-r--r--arch/m68k/mac/macints.c760
-rw-r--r--arch/m68k/mac/misc.c651
-rw-r--r--arch/m68k/mac/oss.c301
-rw-r--r--arch/m68k/mac/psc.c197
-rw-r--r--arch/m68k/mac/via.c619
14 files changed, 5188 insertions, 0 deletions
diff --git a/arch/m68k/mac/Makefile b/arch/m68k/mac/Makefile
new file mode 100644
index 00000000000..995a09d912f
--- /dev/null
+++ b/arch/m68k/mac/Makefile
@@ -0,0 +1,6 @@
+#
+# Makefile for Linux arch/m68k/mac source directory
+#
+
+obj-y := config.o bootparse.o macints.o iop.o via.o oss.o psc.o \
+ baboon.o macboing.o debug.o misc.o mac_ksyms.o
diff --git a/arch/m68k/mac/baboon.c b/arch/m68k/mac/baboon.c
new file mode 100644
index 00000000000..b19b7dd9bd2
--- /dev/null
+++ b/arch/m68k/mac/baboon.c
@@ -0,0 +1,126 @@
+/*
+ * Baboon Custom IC Management
+ *
+ * The Baboon custom IC controls the IDE, PCMCIA and media bay on the
+ * PowerBook 190. It multiplexes multiple interrupt sources onto the
+ * Nubus slot $C interrupt.
+ */
+
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/mm.h>
+#include <linux/delay.h>
+#include <linux/init.h>
+#include <linux/ide.h>
+
+#include <asm/traps.h>
+#include <asm/bootinfo.h>
+#include <asm/macintosh.h>
+#include <asm/macints.h>
+#include <asm/mac_baboon.h>
+
+/* #define DEBUG_BABOON */
+/* #define DEBUG_IRQS */
+
+int baboon_present,baboon_active;
+volatile struct baboon *baboon;
+
+irqreturn_t baboon_irq(int, void *, struct pt_regs *);
+
+#if 0
+extern int macide_ack_intr(struct ata_channel *);
+#endif
+
+/*
+ * Baboon initialization.
+ */
+
+void __init baboon_init(void)
+{
+ if (macintosh_config->ident != MAC_MODEL_PB190) {
+ baboon = NULL;
+ baboon_present = 0;
+ return;
+ }
+
+ baboon = (struct baboon *) BABOON_BASE;
+ baboon_present = 1;
+ baboon_active = 0;
+
+ printk("Baboon detected at %p\n", baboon);
+}
+
+/*
+ * Register the Baboon interrupt dispatcher on nubus slot $C.
+ */
+
+void __init baboon_register_interrupts(void)
+{
+ request_irq(IRQ_NUBUS_C, baboon_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST,
+ "baboon", (void *) baboon);
+}
+
+/*
+ * Baboon interrupt handler. This works a lot like a VIA.
+ */
+
+irqreturn_t baboon_irq(int irq, void *dev_id, struct pt_regs *regs)
+{
+ int irq_bit,i;
+ unsigned char events;
+
+#ifdef DEBUG_IRQS
+ printk("baboon_irq: mb_control %02X mb_ifr %02X mb_status %02X active %02X\n",
+ (uint) baboon->mb_control, (uint) baboon->mb_ifr,
+ (uint) baboon->mb_status, baboon_active);
+#endif
+
+ if (!(events = baboon->mb_ifr & 0x07))
+ return IRQ_NONE;
+
+ for (i = 0, irq_bit = 1 ; i < 3 ; i++, irq_bit <<= 1) {
+ if (events & irq_bit/* & baboon_active*/) {
+ baboon_active &= ~irq_bit;
+ mac_do_irq_list(IRQ_BABOON_0 + i, regs);
+ baboon_active |= irq_bit;
+ baboon->mb_ifr &= ~irq_bit;
+ }
+ }
+#if 0
+ if (baboon->mb_ifr & 0x02) macide_ack_intr(NULL);
+ /* for now we need to smash all interrupts */
+ baboon->mb_ifr &= ~events;
+#endif
+ return IRQ_HANDLED;
+}
+
+void baboon_irq_enable(int irq) {
+ int irq_idx = IRQ_IDX(irq);
+
+#ifdef DEBUG_IRQUSE
+ printk("baboon_irq_enable(%d)\n", irq);
+#endif
+ baboon_active |= (1 << irq_idx);
+}
+
+void baboon_irq_disable(int irq) {
+ int irq_idx = IRQ_IDX(irq);
+
+#ifdef DEBUG_IRQUSE
+ printk("baboon_irq_disable(%d)\n", irq);
+#endif
+ baboon_active &= ~(1 << irq_idx);
+}
+
+void baboon_irq_clear(int irq) {
+ int irq_idx = IRQ_IDX(irq);
+
+ baboon->mb_ifr &= ~(1 << irq_idx);
+}
+
+int baboon_irq_pending(int irq)
+{
+ int irq_idx = IRQ_IDX(irq);
+
+ return baboon->mb_ifr & (1 << irq_idx);
+}
diff --git a/arch/m68k/mac/bootparse.c b/arch/m68k/mac/bootparse.c
new file mode 100644
index 00000000000..36d22360982
--- /dev/null
+++ b/arch/m68k/mac/bootparse.c
@@ -0,0 +1,122 @@
+#include <linux/string.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <asm/irq.h>
+#include <asm/setup.h>
+#include <asm/bootinfo.h>
+#include <asm/macintosh.h>
+
+/*
+ * Booter vars
+ */
+
+int boothowto;
+int _boothowto;
+
+/*
+ * Called early to parse the environment (passed to us from the booter)
+ * into a bootinfo struct. Will die as soon as we have our own booter
+ */
+
+#define atol(x) simple_strtoul(x,NULL,0)
+
+void parse_booter(char *env)
+{
+ char *name;
+ char *value;
+#if 0
+ while(0 && *env)
+#else
+ while(*env)
+#endif
+ {
+ name=env;
+ value=name;
+ while(*value!='='&&*value)
+ value++;
+ if(*value=='=')
+ *value++=0;
+ env=value;
+ while(*env)
+ env++;
+ env++;
+#if 0
+ if(strcmp(name,"VIDEO_ADDR")==0)
+ mac_mch.videoaddr=atol(value);
+ if(strcmp(name,"ROW_BYTES")==0)
+ mac_mch.videorow=atol(value);
+ if(strcmp(name,"SCREEN_DEPTH")==0)
+ mac_mch.videodepth=atol(value);
+ if(strcmp(name,"DIMENSIONS")==0)
+ mac_mch.dimensions=atol(value);
+#endif
+ if(strcmp(name,"BOOTTIME")==0)
+ mac_bi_data.boottime=atol(value);
+ if(strcmp(name,"GMTBIAS")==0)
+ mac_bi_data.gmtbias=atol(value);
+ if(strcmp(name,"BOOTERVER")==0)
+ mac_bi_data.bootver=atol(value);
+ if(strcmp(name,"MACOS_VIDEO")==0)
+ mac_bi_data.videological=atol(value);
+ if(strcmp(name,"MACOS_SCC")==0)
+ mac_bi_data.sccbase=atol(value);
+ if(strcmp(name,"MACHINEID")==0)
+ mac_bi_data.id=atol(value);
+ if(strcmp(name,"MEMSIZE")==0)
+ mac_bi_data.memsize=atol(value);
+ if(strcmp(name,"SERIAL_MODEM_FLAGS")==0)
+ mac_bi_data.serialmf=atol(value);
+ if(strcmp(name,"SERIAL_MODEM_HSKICLK")==0)
+ mac_bi_data.serialhsk=atol(value);
+ if(strcmp(name,"SERIAL_MODEM_GPICLK")==0)
+ mac_bi_data.serialgpi=atol(value);
+ if(strcmp(name,"SERIAL_PRINT_FLAGS")==0)
+ mac_bi_data.printmf=atol(value);
+ if(strcmp(name,"SERIAL_PRINT_HSKICLK")==0)
+ mac_bi_data.printhsk=atol(value);
+ if(strcmp(name,"SERIAL_PRINT_GPICLK")==0)
+ mac_bi_data.printgpi=atol(value);
+ if(strcmp(name,"PROCESSOR")==0)
+ mac_bi_data.cpuid=atol(value);
+ if(strcmp(name,"ROMBASE")==0)
+ mac_bi_data.rombase=atol(value);
+ if(strcmp(name,"TIMEDBRA")==0)
+ mac_bi_data.timedbra=atol(value);
+ if(strcmp(name,"ADBDELAY")==0)
+ mac_bi_data.adbdelay=atol(value);
+ }
+#if 0 /* XXX: TODO with m68k_mach_* */
+ /* Fill in the base stuff */
+ boot_info.machtype=MACH_MAC;
+ /* Read this from the macinfo we got ! */
+/* boot_info.cputype=CPU_68020|FPUB_68881;*/
+/* boot_info.memory[0].addr=0;*/
+/* boot_info.memory[0].size=((mac_bi_data.id>>7)&31)<<20;*/
+ boot_info.num_memory=1; /* On a MacII */
+ boot_info.ramdisk_size=0; /* For now */
+ *boot_info.command_line=0;
+#endif
+ }
+
+
+void print_booter(char *env)
+{
+ char *name;
+ char *value;
+ while(*env)
+ {
+ name=env;
+ value=name;
+ while(*value!='='&&*value)
+ value++;
+ if(*value=='=')
+ *value++=0;
+ env=value;
+ while(*env)
+ env++;
+ env++;
+ printk("%s=%s\n", name,value);
+ }
+ }
+
+
diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c
new file mode 100644
index 00000000000..cd19cbb213e
--- /dev/null
+++ b/arch/m68k/mac/config.c
@@ -0,0 +1,902 @@
+/*
+ * linux/arch/m68k/mac/config.c
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file COPYING in the main directory of this archive
+ * for more details.
+ */
+
+/*
+ * Miscellaneous linux stuff
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/mm.h>
+#include <linux/tty.h>
+#include <linux/console.h>
+#include <linux/interrupt.h>
+/* keyb */
+#include <linux/random.h>
+#include <linux/delay.h>
+/* keyb */
+#include <linux/init.h>
+#include <linux/vt_kern.h>
+
+#define BOOTINFO_COMPAT_1_0
+#include <asm/setup.h>
+#include <asm/bootinfo.h>
+
+#include <asm/system.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/pgtable.h>
+#include <asm/rtc.h>
+#include <asm/machdep.h>
+
+#include <asm/macintosh.h>
+#include <asm/macints.h>
+#include <asm/machw.h>
+
+#include <asm/mac_iop.h>
+#include <asm/mac_via.h>
+#include <asm/mac_oss.h>
+#include <asm/mac_psc.h>
+
+/* Mac bootinfo struct */
+
+struct mac_booter_data mac_bi_data;
+int mac_bisize = sizeof mac_bi_data;
+
+struct mac_hw_present mac_hw_present;
+
+/* New m68k bootinfo stuff and videobase */
+
+extern int m68k_num_memory;
+extern struct mem_info m68k_memory[NUM_MEMINFO];
+
+extern struct mem_info m68k_ramdisk;
+
+extern char m68k_command_line[CL_SIZE];
+
+void *mac_env; /* Loaded by the boot asm */
+
+/* The phys. video addr. - might be bogus on some machines */
+unsigned long mac_orig_videoaddr;
+
+/* Mac specific timer functions */
+extern unsigned long mac_gettimeoffset (void);
+extern int mac_hwclk (int, struct rtc_time *);
+extern int mac_set_clock_mmss (unsigned long);
+extern int show_mac_interrupts(struct seq_file *, void *);
+extern void iop_preinit(void);
+extern void iop_init(void);
+extern void via_init(void);
+extern void via_init_clock(irqreturn_t (*func)(int, void *, struct pt_regs *));
+extern void via_flush_cache(void);
+extern void oss_init(void);
+extern void psc_init(void);
+extern void baboon_init(void);
+
+extern void mac_mksound(unsigned int, unsigned int);
+
+extern void nubus_sweep_video(void);
+
+/* Mac specific debug functions (in debug.c) */
+extern void mac_debug_init(void);
+extern void mac_debugging_long(int, long);
+
+static void mac_get_model(char *str);
+
+void mac_bang(int irq, void *vector, struct pt_regs *p)
+{
+ printk(KERN_INFO "Resetting ...\n");
+ mac_reset();
+}
+
+static void mac_sched_init(irqreturn_t (*vector)(int, void *, struct pt_regs *))
+{
+ via_init_clock(vector);
+}
+
+#if 0
+void mac_waitbut (void)
+{
+ ;
+}
+#endif
+
+extern irqreturn_t mac_default_handler(int, void *, struct pt_regs *);
+
+irqreturn_t (*mac_handlers[8])(int, void *, struct pt_regs *)=
+{
+ mac_default_handler,
+ mac_default_handler,
+ mac_default_handler,
+ mac_default_handler,
+ mac_default_handler,
+ mac_default_handler,
+ mac_default_handler,
+ mac_default_handler
+};
+
+/*
+ * Parse a Macintosh-specific record in the bootinfo
+ */
+
+int __init mac_parse_bootinfo(const struct bi_record *record)
+{
+ int unknown = 0;
+ const u_long *data = record->data;
+
+ switch (record->tag) {
+ case BI_MAC_MODEL:
+ mac_bi_data.id = *data;
+ break;
+ case BI_MAC_VADDR:
+ mac_bi_data.videoaddr = *data;
+ break;
+ case BI_MAC_VDEPTH:
+ mac_bi_data.videodepth = *data;
+ break;
+ case BI_MAC_VROW:
+ mac_bi_data.videorow = *data;
+ break;
+ case BI_MAC_VDIM:
+ mac_bi_data.dimensions = *data;
+ break;
+ case BI_MAC_VLOGICAL:
+ mac_bi_data.videological = VIDEOMEMBASE + (*data & ~VIDEOMEMMASK);
+ mac_orig_videoaddr = *data;
+ break;
+ case BI_MAC_SCCBASE:
+ mac_bi_data.sccbase = *data;
+ break;
+ case BI_MAC_BTIME:
+ mac_bi_data.boottime = *data;
+ break;
+ case BI_MAC_GMTBIAS:
+ mac_bi_data.gmtbias = *data;
+ break;
+ case BI_MAC_MEMSIZE:
+ mac_bi_data.memsize = *data;
+ break;
+ case BI_MAC_CPUID:
+ mac_bi_data.cpuid = *data;
+ break;
+ case BI_MAC_ROMBASE:
+ mac_bi_data.rombase = *data;
+ break;
+ default:
+ unknown = 1;
+ }
+ return(unknown);
+}
+
+/*
+ * Flip into 24bit mode for an instant - flushes the L2 cache card. We
+ * have to disable interrupts for this. Our IRQ handlers will crap
+ * themselves if they take an IRQ in 24bit mode!
+ */
+
+static void mac_cache_card_flush(int writeback)
+{
+ unsigned long flags;
+ local_irq_save(flags);
+ via_flush_cache();
+ local_irq_restore(flags);
+}
+
+void __init config_mac(void)
+{
+ if (!MACH_IS_MAC) {
+ printk(KERN_ERR "ERROR: no Mac, but config_mac() called!! \n");
+ }
+
+ mach_sched_init = mac_sched_init;
+ mach_init_IRQ = mac_init_IRQ;
+ mach_request_irq = mac_request_irq;
+ mach_free_irq = mac_free_irq;
+ enable_irq = mac_enable_irq;
+ disable_irq = mac_disable_irq;
+ mach_get_model = mac_get_model;
+ mach_default_handler = &mac_handlers;
+ mach_get_irq_list = show_mac_interrupts;
+ mach_gettimeoffset = mac_gettimeoffset;
+#warning move to adb/via init
+#if 0
+ mach_hwclk = mac_hwclk;
+#endif
+ mach_set_clock_mmss = mac_set_clock_mmss;
+ mach_reset = mac_reset;
+ mach_halt = mac_poweroff;
+ mach_power_off = mac_poweroff;
+#ifdef CONFIG_DUMMY_CONSOLE
+ conswitchp = &dummy_con;
+#endif
+ mach_max_dma_address = 0xffffffff;
+#if 0
+ mach_debug_init = mac_debug_init;
+#endif
+#if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE)
+ mach_beep = mac_mksound;
+#endif
+#ifdef CONFIG_HEARTBEAT
+#if 0
+ mach_heartbeat = mac_heartbeat;
+ mach_heartbeat_irq = IRQ_MAC_TIMER;
+#endif
+#endif
+
+ /*
+ * Determine hardware present
+ */
+
+ mac_identify();
+ mac_report_hardware();
+
+ /* AFAIK only the IIci takes a cache card. The IIfx has onboard
+ cache ... someone needs to figure out how to tell if it's on or
+ not. */
+
+ if (macintosh_config->ident == MAC_MODEL_IICI
+ || macintosh_config->ident == MAC_MODEL_IIFX) {
+ mach_l2_flush = mac_cache_card_flush;
+ }
+
+ /*
+ * Check for machine specific fixups.
+ */
+
+#ifdef OLD_NUBUS_CODE
+ nubus_sweep_video();
+#endif
+}
+
+
+/*
+ * Macintosh Table: hardcoded model configuration data.
+ *
+ * Much of this was defined by Alan, based on who knows what docs.
+ * I've added a lot more, and some of that was pure guesswork based
+ * on hardware pages present on the Mac web site. Possibly wildly
+ * inaccurate, so look here if a new Mac model won't run. Example: if
+ * a Mac crashes immediately after the VIA1 registers have been dumped
+ * to the screen, it probably died attempting to read DirB on a RBV.
+ * Meaning it should have MAC_VIA_IIci here :-)
+ */
+
+struct mac_model *macintosh_config;
+EXPORT_SYMBOL(macintosh_config);
+
+static struct mac_model mac_data_table[]=
+{
+ /*
+ * We'll pretend to be a Macintosh II, that's pretty safe.
+ */
+
+ {
+ .ident = MAC_MODEL_II,
+ .name = "Unknown",
+ .adb_type = MAC_ADB_II,
+ .via_type = MAC_VIA_II,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_II,
+ .nubus_type = MAC_NUBUS
+ },
+
+ /*
+ * Original MacII hardware
+ *
+ */
+
+ {
+ .ident = MAC_MODEL_II,
+ .name = "II",
+ .adb_type = MAC_ADB_II,
+ .via_type = MAC_VIA_II,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_II,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_IIX,
+ .name = "IIx",
+ .adb_type = MAC_ADB_II,
+ .via_type = MAC_VIA_II,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_II,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_IICX,
+ .name = "IIcx",
+ .adb_type = MAC_ADB_II,
+ .via_type = MAC_VIA_II,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_II,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_SE30,
+ .name = "SE/30",
+ .adb_type = MAC_ADB_II,
+ .via_type = MAC_VIA_II,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_II,
+ .nubus_type = MAC_NUBUS
+ },
+
+ /*
+ * Weirdified MacII hardware - all subtley different. Gee thanks
+ * Apple. All these boxes seem to have VIA2 in a different place to
+ * the MacII (+1A000 rather than +4000)
+ * CSA: see http://developer.apple.com/technotes/hw/hw_09.html
+ */
+
+ {
+ .ident = MAC_MODEL_IICI,
+ .name = "IIci",
+ .adb_type = MAC_ADB_II,
+ .via_type = MAC_VIA_IIci,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_II,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_IIFX,
+ .name = "IIfx",
+ .adb_type = MAC_ADB_IOP,
+ .via_type = MAC_VIA_IIci,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_IOP,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_IISI,
+ .name = "IIsi",
+ .adb_type = MAC_ADB_IISI,
+ .via_type = MAC_VIA_IIci,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_II,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_IIVI,
+ .name = "IIvi",
+ .adb_type = MAC_ADB_IISI,
+ .via_type = MAC_VIA_IIci,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_II,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_IIVX,
+ .name = "IIvx",
+ .adb_type = MAC_ADB_IISI,
+ .via_type = MAC_VIA_IIci,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_II,
+ .nubus_type = MAC_NUBUS
+ },
+
+ /*
+ * Classic models (guessing: similar to SE/30 ?? Nope, similar to LC ...)
+ */
+
+ {
+ .ident = MAC_MODEL_CLII,
+ .name = "Classic II",
+ .adb_type = MAC_ADB_IISI,
+ .via_type = MAC_VIA_IIci,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_II,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_CCL,
+ .name = "Color Classic",
+ .adb_type = MAC_ADB_CUDA,
+ .via_type = MAC_VIA_IIci,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_II,
+ .nubus_type = MAC_NUBUS},
+
+ /*
+ * Some Mac LC machines. Basically the same as the IIci, ADB like IIsi
+ */
+
+ {
+ .ident = MAC_MODEL_LC,
+ .name = "LC",
+ .adb_type = MAC_ADB_IISI,
+ .via_type = MAC_VIA_IIci,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_II,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_LCII,
+ .name = "LC II",
+ .adb_type = MAC_ADB_IISI,
+ .via_type = MAC_VIA_IIci,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_II,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_LCIII,
+ .name = "LC III",
+ .adb_type = MAC_ADB_IISI,
+ .via_type = MAC_VIA_IIci,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_II,
+ .nubus_type = MAC_NUBUS
+ },
+
+ /*
+ * Quadra. Video is at 0xF9000000, via is like a MacII. We label it differently
+ * as some of the stuff connected to VIA2 seems different. Better SCSI chip and
+ * onboard ethernet using a NatSemi SONIC except the 660AV and 840AV which use an
+ * AMD 79C940 (MACE).
+ * The 700, 900 and 950 have some I/O chips in the wrong place to
+ * confuse us. The 840AV has a SCSI location of its own (same as
+ * the 660AV).
+ */
+
+ {
+ .ident = MAC_MODEL_Q605,
+ .name = "Quadra 605",
+ .adb_type = MAC_ADB_CUDA,
+ .via_type = MAC_VIA_QUADRA,
+ .scsi_type = MAC_SCSI_QUADRA,
+ .scc_type = MAC_SCC_QUADRA,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_Q605_ACC,
+ .name = "Quadra 605",
+ .adb_type = MAC_ADB_CUDA,
+ .via_type = MAC_VIA_QUADRA,
+ .scsi_type = MAC_SCSI_QUADRA,
+ .scc_type = MAC_SCC_QUADRA,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_Q610,
+ .name = "Quadra 610",
+ .adb_type = MAC_ADB_II,
+ .via_type = MAC_VIA_QUADRA,
+ .scsi_type = MAC_SCSI_QUADRA,
+ .scc_type = MAC_SCC_QUADRA,
+ .ether_type = MAC_ETHER_SONIC,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_Q630,
+ .name = "Quadra 630",
+ .adb_type = MAC_ADB_CUDA,
+ .via_type = MAC_VIA_QUADRA,
+ .scsi_type = MAC_SCSI_QUADRA,
+ .ide_type = MAC_IDE_QUADRA,
+ .scc_type = MAC_SCC_QUADRA,
+ .ether_type = MAC_ETHER_SONIC,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_Q650,
+ .name = "Quadra 650",
+ .adb_type = MAC_ADB_II,
+ .via_type = MAC_VIA_QUADRA,
+ .scsi_type = MAC_SCSI_QUADRA,
+ .scc_type = MAC_SCC_QUADRA,
+ .ether_type = MAC_ETHER_SONIC,
+ .nubus_type = MAC_NUBUS
+ },
+ /* The Q700 does have a NS Sonic */
+ {
+ .ident = MAC_MODEL_Q700,
+ .name = "Quadra 700",
+ .adb_type = MAC_ADB_II,
+ .via_type = MAC_VIA_QUADRA,
+ .scsi_type = MAC_SCSI_QUADRA2,
+ .scc_type = MAC_SCC_QUADRA,
+ .ether_type = MAC_ETHER_SONIC,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_Q800,
+ .name = "Quadra 800",
+ .adb_type = MAC_ADB_II,
+ .via_type = MAC_VIA_QUADRA,
+ .scsi_type = MAC_SCSI_QUADRA,
+ .scc_type = MAC_SCC_QUADRA,
+ .ether_type = MAC_ETHER_SONIC,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_Q840,
+ .name = "Quadra 840AV",
+ .adb_type = MAC_ADB_CUDA,
+ .via_type = MAC_VIA_QUADRA,
+ .scsi_type = MAC_SCSI_QUADRA3,
+ .scc_type = MAC_SCC_PSC,
+ .ether_type = MAC_ETHER_MACE,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_Q900,
+ .name = "Quadra 900",
+ .adb_type = MAC_ADB_IOP,
+ .via_type = MAC_VIA_QUADRA,
+ .scsi_type = MAC_SCSI_QUADRA2,
+ .scc_type = MAC_SCC_IOP,
+ .ether_type = MAC_ETHER_SONIC,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_Q950,
+ .name = "Quadra 950",
+ .adb_type = MAC_ADB_IOP,
+ .via_type = MAC_VIA_QUADRA,
+ .scsi_type = MAC_SCSI_QUADRA2,
+ .scc_type = MAC_SCC_IOP,
+ .ether_type = MAC_ETHER_SONIC,
+ .nubus_type = MAC_NUBUS
+ },
+
+ /*
+ * Performa - more LC type machines
+ */
+
+ {
+ .ident = MAC_MODEL_P460,
+ .name = "Performa 460",
+ .adb_type = MAC_ADB_IISI,
+ .via_type = MAC_VIA_IIci,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_II,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_P475,
+ .name = "Performa 475",
+ .adb_type = MAC_ADB_CUDA,
+ .via_type = MAC_VIA_QUADRA,
+ .scsi_type = MAC_SCSI_QUADRA,
+ .scc_type = MAC_SCC_II,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_P475F,
+ .name = "Performa 475",
+ .adb_type = MAC_ADB_CUDA,
+ .via_type = MAC_VIA_QUADRA,
+ .scsi_type = MAC_SCSI_QUADRA,
+ .scc_type = MAC_SCC_II,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_P520,
+ .name = "Performa 520",
+ .adb_type = MAC_ADB_CUDA,
+ .via_type = MAC_VIA_IIci,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_II,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_P550,
+ .name = "Performa 550",
+ .adb_type = MAC_ADB_CUDA,
+ .via_type = MAC_VIA_IIci,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_II,
+ .nubus_type = MAC_NUBUS
+ },
+ /* These have the comm slot, and therefore the possibility of SONIC ethernet */
+ {
+ .ident = MAC_MODEL_P575,
+ .name = "Performa 575",
+ .adb_type = MAC_ADB_CUDA,
+ .via_type = MAC_VIA_QUADRA,
+ .scsi_type = MAC_SCSI_QUADRA,
+ .scc_type = MAC_SCC_II,
+ .ether_type = MAC_ETHER_SONIC,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_P588,
+ .name = "Performa 588",
+ .adb_type = MAC_ADB_CUDA,
+ .via_type = MAC_VIA_QUADRA,
+ .scsi_type = MAC_SCSI_QUADRA,
+ .ide_type = MAC_IDE_QUADRA,
+ .scc_type = MAC_SCC_II,
+ .ether_type = MAC_ETHER_SONIC,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_TV,
+ .name = "TV",
+ .adb_type = MAC_ADB_CUDA,
+ .via_type = MAC_VIA_QUADRA,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_II,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_P600,
+ .name = "Performa 600",
+ .adb_type = MAC_ADB_IISI,
+ .via_type = MAC_VIA_IIci,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_II,
+ .nubus_type = MAC_NUBUS
+ },
+
+ /*
+ * Centris - just guessing again; maybe like Quadra
+ */
+
+ /* The C610 may or may not have SONIC. We probe to make sure */
+ {
+ .ident = MAC_MODEL_C610,
+ .name = "Centris 610",
+ .adb_type = MAC_ADB_II,
+ .via_type = MAC_VIA_QUADRA,
+ .scsi_type = MAC_SCSI_QUADRA,
+ .scc_type = MAC_SCC_QUADRA,
+ .ether_type = MAC_ETHER_SONIC,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_C650,
+ .name = "Centris 650",
+ .adb_type = MAC_ADB_II,
+ .via_type = MAC_VIA_QUADRA,
+ .scsi_type = MAC_SCSI_QUADRA,
+ .scc_type = MAC_SCC_QUADRA,
+ .ether_type = MAC_ETHER_SONIC,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_C660,
+ .name = "Centris 660AV",
+ .adb_type = MAC_ADB_CUDA,
+ .via_type = MAC_VIA_QUADRA,
+ .scsi_type = MAC_SCSI_QUADRA3,
+ .scc_type = MAC_SCC_PSC,
+ .ether_type = MAC_ETHER_MACE,
+ .nubus_type = MAC_NUBUS
+ },
+
+ /*
+ * The PowerBooks all the same "Combo" custom IC for SCSI and SCC
+ * and a PMU (in two variations?) for ADB. Most of them use the
+ * Quadra-style VIAs. A few models also have IDE from hell.
+ */
+
+ {
+ .ident = MAC_MODEL_PB140,
+ .name = "PowerBook 140",
+ .adb_type = MAC_ADB_PB1,
+ .via_type = MAC_VIA_QUADRA,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_QUADRA,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_PB145,
+ .name = "PowerBook 145",
+ .adb_type = MAC_ADB_PB1,
+ .via_type = MAC_VIA_QUADRA,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_QUADRA,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_PB150,
+ .name = "PowerBook 150",
+ .adb_type = MAC_ADB_PB1,
+ .via_type = MAC_VIA_IIci,
+ .scsi_type = MAC_SCSI_OLD,
+ .ide_type = MAC_IDE_PB,
+ .scc_type = MAC_SCC_QUADRA,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_PB160,
+ .name = "PowerBook 160",
+ .adb_type = MAC_ADB_PB1,
+ .via_type = MAC_VIA_QUADRA,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_QUADRA,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_PB165,
+ .name = "PowerBook 165",
+ .adb_type = MAC_ADB_PB1,
+ .via_type = MAC_VIA_QUADRA,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_QUADRA,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_PB165C,
+ .name = "PowerBook 165c",
+ .adb_type = MAC_ADB_PB1,
+ .via_type = MAC_VIA_QUADRA,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_QUADRA,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_PB170,
+ .name = "PowerBook 170",
+ .adb_type = MAC_ADB_PB1,
+ .via_type = MAC_VIA_QUADRA,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_QUADRA,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_PB180,
+ .name = "PowerBook 180",
+ .adb_type = MAC_ADB_PB1,
+ .via_type = MAC_VIA_QUADRA,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_QUADRA,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_PB180C,
+ .name = "PowerBook 180c",
+ .adb_type = MAC_ADB_PB1,
+ .via_type = MAC_VIA_QUADRA,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_QUADRA,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_PB190,
+ .name = "PowerBook 190",
+ .adb_type = MAC_ADB_PB2,
+ .via_type = MAC_VIA_QUADRA,
+ .scsi_type = MAC_SCSI_OLD,
+ .ide_type = MAC_IDE_BABOON,
+ .scc_type = MAC_SCC_QUADRA,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_PB520,
+ .name = "PowerBook 520",
+ .adb_type = MAC_ADB_PB2,
+ .via_type = MAC_VIA_QUADRA,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_QUADRA,
+ .ether_type = MAC_ETHER_SONIC,
+ .nubus_type = MAC_NUBUS
+ },
+
+ /*
+ * PowerBook Duos are pretty much like normal PowerBooks
+ * All of these probably have onboard SONIC in the Dock which
+ * means we'll have to probe for it eventually.
+ *
+ * Are these reallly MAC_VIA_IIci? The developer notes for the
+ * Duos show pretty much the same custom parts as in most of
+ * the other PowerBooks which would imply MAC_VIA_QUADRA.
+ */
+
+ {
+ .ident = MAC_MODEL_PB210,
+ .name = "PowerBook Duo 210",
+ .adb_type = MAC_ADB_PB2,
+ .via_type = MAC_VIA_IIci,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_QUADRA,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_PB230,
+ .name = "PowerBook Duo 230",
+ .adb_type = MAC_ADB_PB2,
+ .via_type = MAC_VIA_IIci,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_QUADRA,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_PB250,
+ .name = "PowerBook Duo 250",
+ .adb_type = MAC_ADB_PB2,
+ .via_type = MAC_VIA_IIci,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_QUADRA,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_PB270C,
+ .name = "PowerBook Duo 270c",
+ .adb_type = MAC_ADB_PB2,
+ .via_type = MAC_VIA_IIci,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_QUADRA,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_PB280,
+ .name = "PowerBook Duo 280",
+ .adb_type = MAC_ADB_PB2,
+ .via_type = MAC_VIA_IIci,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_QUADRA,
+ .nubus_type = MAC_NUBUS
+ }, {
+ .ident = MAC_MODEL_PB280C,
+ .name = "PowerBook Duo 280c",
+ .adb_type = MAC_ADB_PB2,
+ .via_type = MAC_VIA_IIci,
+ .scsi_type = MAC_SCSI_OLD,
+ .scc_type = MAC_SCC_QUADRA,
+ .nubus_type = MAC_NUBUS
+ },
+
+ /*
+ * Other stuff ??
+ */
+ {
+ .ident = -1
+ }
+};
+
+void mac_identify(void)
+{
+ struct mac_model *m;
+
+ /* Penguin data useful? */
+ int model = mac_bi_data.id;
+ if (!model) {
+ /* no bootinfo model id -> NetBSD booter was used! */
+ /* XXX FIXME: breaks for model > 31 */
+ model=(mac_bi_data.cpuid>>2)&63;
+ printk (KERN_WARNING "No bootinfo model ID, using cpuid instead (hey, use Penguin!)\n");
+ }
+
+ macintosh_config = mac_data_table;
+ for (m = macintosh_config ; m->ident != -1 ; m++) {
+ if (m->ident == model) {
+ macintosh_config = m;
+ break;
+ }
+ }
+
+ /* We need to pre-init the IOPs, if any. Otherwise */
+ /* the serial console won't work if the user had */
+ /* the serial ports set to "Faster" mode in MacOS. */
+
+ iop_preinit();
+ mac_debug_init();
+
+ printk (KERN_INFO "Detected Macintosh model: %d \n", model);
+
+ /*
+ * Report booter data:
+ */
+ printk (KERN_DEBU