patch-2.4.19 linux-2.4.19/arch/mips64/sgi-ip32/ip32-setup.c

Next file: linux-2.4.19/arch/mips64/sgi-ip32/ip32-timer.c
Previous file: linux-2.4.19/arch/mips64/sgi-ip32/ip32-reset.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.18/arch/mips64/sgi-ip32/ip32-setup.c linux-2.4.19/arch/mips64/sgi-ip32/ip32-setup.c
@@ -7,15 +7,16 @@
  *
  * Copyright (C) 2000 Harald Koerfgen
  */
+#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/interrupt.h>
 #include <linux/mc146818rtc.h>
 #include <linux/param.h>
 #include <linux/init.h>
-#include <linux/irq.h>
+
+#include <asm/time.h>
 #include <asm/mipsregs.h>
 #include <asm/bootinfo.h>
-#include <asm/irq.h>
 #include <asm/mmu_context.h>
 #include <asm/ip32/crime.h>
 #include <asm/ip32/mace.h>
@@ -25,10 +26,40 @@
 extern struct rtc_ops ip32_rtc_ops;
 extern u32 cc_interval;
 
-void __init ip32_init (int argc, char **argv, char **envp) {
-	arc_meminit ();
+#ifdef CONFIG_SGI_O2MACE_ETH
+
+/*
+ * This is taken care of in here 'cause they say using Arc later on is
+ * problematic
+ */
+extern char o2meth_eaddr[8];
+static inline unsigned char str2hexnum(unsigned char c)
+{
+	if (c >= '0' && c <= '9')
+		return c - '0';
+	if (c >= 'a' && c <= 'f')
+		return c - 'a' + 10;
+	return 0; /* foo */
 }
 
+static inline void str2eaddr(unsigned char *ea, unsigned char *str)
+{
+	int i;
+
+	for (i = 0; i < 6; i++) {
+		unsigned char num;
+
+		if(*str == ':')
+			str++;
+		num = str2hexnum(*str++) << 4;
+		num |= (str2hexnum(*str++));
+		ea[i] = num;
+	}
+}
+#endif
+
+extern void ip32_time_init(void);
+
 void __init ip32_setup(void)
 {
 #ifdef CONFIG_SERIAL_CONSOLE
@@ -36,6 +67,8 @@
 #endif
 	TLBMISS_HANDLER_SETUP ();
 
+	mips_io_port_base = UNCACHEDADDR(MACEPCI_HI_IO);;
+
 #ifdef CONFIG_SERIAL_CONSOLE
 	ctype = ArcGetEnvironmentVariable("console");
 	if (*ctype == 'd') {
@@ -45,12 +78,19 @@
 			console_setup ("ttyS0");
 	}
 #endif
+#ifdef CONFIG_SGI_O2MACE_ETH
+	{
+		char *mac=ArcGetEnvironmentVariable("eaddr");
+		str2eaddr(o2meth_eaddr, mac);
+	}
+#endif
 
 #ifdef CONFIG_VT
 	conswitchp = &dummy_con;
 #endif
 
 	rtc_ops = &ip32_rtc_ops;
+	board_time_init = ip32_time_init;
 
 	crime_init ();
 }

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