patch-2.1.116 linux/arch/m68k/mac/config.c

Next file: linux/arch/m68k/mac/macints.c
Previous file: linux/arch/m68k/mac/adb-bus.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.115/linux/arch/m68k/mac/config.c linux/arch/m68k/mac/config.c
@@ -35,6 +35,7 @@
 
 #include <asm/macintosh.h>
 #include <asm/macints.h>
+#include <asm/machw.h>
 
 #include "via6522.h"
 
@@ -60,24 +61,43 @@
 /* The phys. video addr. - might be bogus on some machines */
 unsigned long mac_orig_videoaddr;
 
+/* Mac specific keyboard functions */
 extern int mac_keyb_init(void);
 extern int mac_kbdrate(struct kbd_repeat *k);
 extern void mac_kbd_leds(unsigned int leds);
 extern void mac_kbd_reset_setup(char*, int);
 
+/* Mac specific irq functions */
+extern void mac_init_IRQ (void);
+extern void (*mac_handlers[]) (int, void *, struct pt_regs *);
+extern int mac_request_irq (unsigned int irq,
+			    void (*handler)(int, void *, struct pt_regs *),
+                            unsigned long flags, const char *devname,
+			    void *dev_id);
+extern void mac_free_irq (unsigned int irq, void *dev_id);
+extern void mac_enable_irq (unsigned int);
+extern void mac_disable_irq (unsigned int);
+static void mac_get_model(char *model);
+/*static int mac_get_hardware_list(char *buffer);*/
+extern int mac_get_irq_list (char *);
+
+/* Mac specific timer functions */
+extern unsigned long mac_gettimeoffset (void);
+extern void mac_gettod (int *, int *, int *, int *, int *, int *);
+extern int mac_hwclk (int, struct hwclk_time *);
+extern int mac_set_clock_mmss (unsigned long);
+extern void via_init_clock(void (*func)(int, void *, struct pt_regs *));
+
 extern void (*kd_mksound)(unsigned int, unsigned int);
 extern void mac_mksound(unsigned int, unsigned int);
 extern int mac_floppy_init(void);
 extern void mac_floppy_setup(char *,int *);
 
-extern void mac_gettod (int *, int *, int *, int *, int *, int *);
-
 extern void nubus_sweep_video(void);
-extern void via_init_clock(void (*func)(int, void *, struct pt_regs *));
-extern void mac_debugging_long(int, long);
 
 /* Mac specific debug functions (in debug.c) */
 extern void mac_debug_init(void);
+extern void mac_debugging_long(int, long);
 
 #ifdef CONFIG_MAGIC_SYSRQ
 
@@ -108,17 +128,11 @@
 	via_init_clock(vector);
 }
 
-unsigned long mac_gettimeoffset (void)
-{
-	return 0L;
-}
-
 extern int console_loglevel;
 
 /*
  * This function translates the boot timeval into a proper date, to initialize
  * the system time.
- * Known problem: off by one after Feb. 27 on leap years
  */
 
 void mac_gettod (int *yearp, int *monp, int *dayp,
@@ -174,6 +188,26 @@
 	return;
 }
 
+/* 
+ * TBI: read and write hwclock
+ */
+
+int mac_hwclk( int op, struct hwclk_time *t )
+{
+    return 0;
+}
+
+/*
+ * TBI: set minutes/seconds in hwclock
+ */
+
+int mac_set_clock_mmss (unsigned long nowtime)
+{
+    short real_seconds = nowtime % 60, real_minutes = (nowtime / 60) % 60;
+
+    return 0;
+}
+
 void mac_waitbut (void)
 {
 	;
@@ -272,6 +306,8 @@
     mach_get_irq_list	 = mac_get_irq_list;
     mach_gettimeoffset   = mac_gettimeoffset;
     mach_gettod          = mac_gettod;
+    mach_hwclk           = mac_hwclk;
+    mach_set_clock_mmss	 = mac_set_clock_mmss;
 #if 0
     mach_mksound         = mac_mksound;
 #endif
@@ -379,7 +415,7 @@
 	 *	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
 	 *	in all cases using a NatSemi SONIC. The 700, 900 and 950 have some I/O chips in the wrong
-	 *	place to confuse us. The 840 seems to have a scsi location of its own
+	 *	place to confuse us. The 840AV seems to have a scsi location of its own
 	 */	 
 	 
 	{	MAC_MODEL_Q605, "Quadra 605", MAC_ADB_CUDA, MAC_VIA_QUADRA, MAC_SCSI_QUADRA,  MAC_IDE_NONE,   MAC_SCC_QUADRA,	MAC_ETHER_SONIC,	MAC_NUBUS},
@@ -389,9 +425,9 @@
 	/*	The Q700 does have a NS Sonic */
 	{	MAC_MODEL_Q700, "Quadra 700", MAC_ADB_II,   MAC_VIA_QUADRA, MAC_SCSI_QUADRA2, MAC_IDE_NONE,   MAC_SCC_QUADRA2,	MAC_ETHER_SONIC,	MAC_NUBUS},
 	{	MAC_MODEL_Q800, "Quadra 800", MAC_ADB_II,   MAC_VIA_QUADRA, MAC_SCSI_QUADRA,  MAC_IDE_NONE,   MAC_SCC_QUADRA,	MAC_ETHER_SONIC,	MAC_NUBUS},
-	/* Does the 840 have ethernet ??? documents seem to indicate its not quite a
+	/* Does the 840AV have ethernet ??? documents seem to indicate its not quite a
 	   Quadra in this respect ? */
-	{	MAC_MODEL_Q840, "Quadra 840", MAC_ADB_CUDA, MAC_VIA_QUADRA, MAC_SCSI_QUADRA3, MAC_IDE_NONE,   MAC_SCC_II,	MAC_ETHER_NONE,		MAC_NUBUS},
+	{	MAC_MODEL_Q840, "Quadra 840AV", MAC_ADB_CUDA, MAC_VIA_QUADRA, MAC_SCSI_QUADRA3, MAC_IDE_NONE,   MAC_SCC_II,	MAC_ETHER_NONE,		MAC_NUBUS},
 	/* These might have IOP problems */
 	{	MAC_MODEL_Q900, "Quadra 900", MAC_ADB_IISI, MAC_VIA_QUADRA, MAC_SCSI_QUADRA2, MAC_IDE_NONE,   MAC_SCC_IOP,	MAC_ETHER_SONIC,	MAC_NUBUS},
 	{	MAC_MODEL_Q950, "Quadra 950", MAC_ADB_IISI, MAC_VIA_QUADRA, MAC_SCSI_QUADRA2, MAC_IDE_NONE,   MAC_SCC_IOP,	MAC_ETHER_SONIC,	MAC_NUBUS},
@@ -418,7 +454,7 @@
 
 	{	MAC_MODEL_C610, "Centris 610",   MAC_ADB_II,   MAC_VIA_QUADRA, MAC_SCSI_QUADRA, MAC_IDE_NONE, MAC_SCC_QUADRA,	MAC_ETHER_NONE,	MAC_NUBUS},
 	{	MAC_MODEL_C650, "Centris 650",   MAC_ADB_II,   MAC_VIA_QUADRA, MAC_SCSI_QUADRA, MAC_IDE_NONE, MAC_SCC_QUADRA,	MAC_ETHER_NONE,	MAC_NUBUS},
-	{	MAC_MODEL_C660, "Centris 660AV", MAC_ADB_CUDA, MAC_VIA_QUADRA, MAC_SCSI_QUADRA, MAC_IDE_NONE, MAC_SCC_QUADRA,	MAC_ETHER_NONE,	MAC_NUBUS},
+	{	MAC_MODEL_C660, "Centris 660AV", MAC_ADB_CUDA, MAC_VIA_QUADRA, MAC_SCSI_QUADRA3, MAC_IDE_NONE, MAC_SCC_QUADRA,	MAC_ETHER_NONE,	MAC_NUBUS},
 
 	/*
 	 *      Power books - seem similar to early Quadras ? (most have 030 though)
@@ -497,10 +533,10 @@
 	 * Report booter data:
 	 */
 	printk (" Penguin bootinfo data:\n");
-	printk (" Video: addr 0x%lx row 0x%lx depth %lx dimensions %d x %d\n", 
+	printk (" Video: addr 0x%lx row 0x%lx depth %lx dimensions %ld x %ld\n", 
 		mac_bi_data.videoaddr, mac_bi_data.videorow, 
-		mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF, 
-		mac_bi_data.dimensions >> 16); 
+		mac_bi_data.videodepth, (int) (mac_bi_data.dimensions & 0xFFFF), 
+		(int) (mac_bi_data.dimensions >> 16)); 
 	printk (" Videological 0x%lx phys. 0x%lx, SCC at 0x%lx \n",
 		mac_bi_data.videological, mac_orig_videoaddr, 
 		mac_bi_data.sccbase); 
@@ -522,6 +558,25 @@
 	/*
 	 * TODO: set the various fields in macintosh_config->hw_present here!
 	 */
+	switch (macintosh_config->scsi_type) {
+	case MAC_SCSI_OLD:
+	  MACHW_SET(MAC_SCSI_80);
+	  break;
+	case MAC_SCSI_QUADRA:
+	case MAC_SCSI_QUADRA2:
+	case MAC_SCSI_QUADRA3:
+	  MACHW_SET(MAC_SCSI_96);
+	  if ((macintosh_config->ident == MAC_MODEL_Q900) ||
+	      (macintosh_config->ident == MAC_MODEL_Q950))
+	    MACHW_SET(MAC_SCSI_96_2);
+	  break;
+	default:
+	  printk("config.c: wtf: unknown scsi, using 53c80\n");
+	  MACHW_SET(MAC_SCSI_80);
+	  break;
+
+	}
+
 
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov