patch-2.4.6 linux/arch/m68k/sun3x/config.c

Next file: linux/arch/m68k/sun3x/dvma.c
Previous file: linux/arch/m68k/sun3x/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.5/linux/arch/m68k/sun3x/config.c linux/arch/m68k/sun3x/config.c
@@ -14,39 +14,24 @@
 #include <asm/system.h>
 #include <asm/machdep.h>
 #include <asm/irq.h>
-#include <asm/sun3x.h>
+#include <asm/sun3xprom.h>
+#include <asm/sun3ints.h>
+#include <asm/setup.h>
 
 #include "time.h"
 
-static volatile unsigned char *sun3x_intreg = (unsigned char *)SUN3X_INTREG;
-extern int serial_console;
+volatile char *clock_va;
+extern volatile unsigned char *sun3_intreg;
 
-void sun3x_halt(void)
-{
-    /* Disable interrupts */
-    cli();
-
-    /* we can't drop back to PROM, so we loop here */
-    for (;;);
-}
-
-void sun3x_reboot(void)
-{
-    /* This never returns, don't bother saving things */
-    cli();
-
-    /* no idea, whether this works */
-    asm ("reset");
-}
 
 int __init sun3x_keyb_init(void)
 {
-    return 0;
+	return 0;
 }
 
 int sun3x_kbdrate(struct kbd_repeat *r)
 {
-    return 0;
+	return 0;
 }
 
 void sun3x_kbd_leds(unsigned int i)
@@ -54,36 +39,15 @@
 
 }
 
-static void sun3x_badint (int irq, void *dev_id, struct pt_regs *fp)
+void sun3_leds(unsigned int i)
 {
-    printk ("received spurious interrupt %d\n",irq);
-    num_spurious += 1;
-}
 
-void (*sun3x_default_handler[SYS_IRQS])(int, void *, struct pt_regs *) = {
-    sun3x_badint, sun3x_badint, sun3x_badint, sun3x_badint,
-    sun3x_badint, sun3x_badint, sun3x_badint, sun3x_badint
-};
-
-void sun3x_enable_irq(unsigned int irq)
-{
-    *sun3x_intreg |= (1 << irq);
 }
 
-void sun3x_disable_irq(unsigned int irq)
+/* should probably detect types of these eventually. */
+static void sun3x_get_model(char *model)
 {
-    *sun3x_intreg &= ~(1 << irq);
-}
-
-void __init sun3x_init_IRQ(void)
-{
-    /* disable all interrupts initially */
-    *sun3x_intreg = 1;  /* master enable only */
-}
-
-int sun3x_get_irq_list(char *buf)
-{
-    return 0;
+	sprintf(model, "Sun3x");
 }
 
 /*
@@ -91,38 +55,51 @@
  */
 void __init config_sun3x(void)
 {
-    mach_get_irq_list	 = sun3x_get_irq_list;
-    mach_max_dma_address = 0xffffffff; /* we can DMA anywhere, whee */
 
-    mach_keyb_init       = sun3x_keyb_init;
-    mach_kbdrate         = sun3x_kbdrate;
-    mach_kbd_leds        = sun3x_kbd_leds;
-
-    mach_sched_init      = sun3x_sched_init;
-    mach_init_IRQ        = sun3x_init_IRQ;
-    enable_irq           = sun3x_enable_irq;
-    disable_irq          = sun3x_disable_irq;
-    mach_request_irq     = sys_request_irq;
-    mach_free_irq        = sys_free_irq;
-    mach_default_handler = &sun3x_default_handler;
-    mach_gettimeoffset   = sun3x_gettimeoffset;
-    mach_reset           = sun3x_reboot;
+	sun3x_prom_init();
+
+	mach_get_irq_list	 = sun3_get_irq_list;
+	mach_max_dma_address = 0xffffffff; /* we can DMA anywhere, whee */
 
-    mach_gettod          = sun3x_gettod;
+	mach_keyb_init       = sun3x_keyb_init;
+	mach_kbdrate         = sun3x_kbdrate;
+	mach_kbd_leds        = sun3x_kbd_leds;
+
+	mach_default_handler = &sun3_default_handler;
+	mach_sched_init      = sun3x_sched_init;
+	mach_init_IRQ        = sun3_init_IRQ;
+	enable_irq           = sun3_enable_irq;
+	disable_irq          = sun3_disable_irq;
+	mach_request_irq     = sun3_request_irq;
+	mach_free_irq        = sun3_free_irq;
+	mach_process_int     = sun3_process_int;
     
-    switch (*(unsigned char *)SUN3X_EEPROM_CONS) {
+	mach_gettimeoffset   = sun3x_gettimeoffset;
+	mach_reset           = sun3x_reboot;
+
+	mach_gettod          = sun3x_gettod;
+	mach_hwclk           = sun3x_hwclk;
+	mach_get_model       = sun3x_get_model;
+
+	sun3_intreg = (unsigned char *)SUN3X_INTREG;
+
+	/* only the serial console is known to work anyway... */
+#if 0    
+	switch (*(unsigned char *)SUN3X_EEPROM_CONS) {
 	case 0x10:
-	    serial_console = 1;
-	    conswitchp = NULL;
-	    break;
+		serial_console = 1;
+		conswitchp = NULL;
+		break;
 	case 0x11:
-	    serial_console = 2;
-	    conswitchp = NULL;
-	    break;
+		serial_console = 2;
+		conswitchp = NULL;
+		break;
 	default:
-	    serial_console = 0;
-	    conswitchp = &dummy_con;
-	    break;
-    }
+		serial_console = 0;
+		conswitchp = &dummy_con;
+		break;
+	}
+#endif
 
 }
+

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)