Module Name:    src
Committed By:   cliff
Date:           Thu Jun 10 01:11:26 UTC 2010

Modified Files:
        src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_cpu.c

Log Message:
- remove rmixl_spl_init_cpu calls from rmixl_intr_init_cpu
  because rmixl_intr_init_cpu only runs on cpu#0.
  rmixl_spl_init_cpu calls are now done in cpu_rmixl_atach (for cpu#0)
  or cpu_rmixl_hatch (for other cpus).
- add cpu_xls616_erratum to avoid count/compare conflict on XLS616
  XXX VERIFY WITH RMI
- rmixl_spl_init_cpu CPU#0 in attach, others in hatch
- remove splhi/splx for non-cpu#0 work in attach
  interrupts arent enabled yet anyway


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.11 -r1.1.2.12 src/sys/arch/mips/rmi/rmixl_cpu.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/mips/rmi/rmixl_cpu.c
diff -u src/sys/arch/mips/rmi/rmixl_cpu.c:1.1.2.11 src/sys/arch/mips/rmi/rmixl_cpu.c:1.1.2.12
--- src/sys/arch/mips/rmi/rmixl_cpu.c:1.1.2.11	Sat May  1 06:10:04 2010
+++ src/sys/arch/mips/rmi/rmixl_cpu.c	Thu Jun 10 01:11:26 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_cpu.c,v 1.1.2.11 2010/05/01 06:10:04 cliff Exp $	*/
+/*	$NetBSD: rmixl_cpu.c,v 1.1.2.12 2010/06/10 01:11:26 cliff Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -38,7 +38,7 @@
 #include "locators.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rmixl_cpu.c,v 1.1.2.11 2010/05/01 06:10:04 cliff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rmixl_cpu.c,v 1.1.2.12 2010/06/10 01:11:26 cliff Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -90,6 +90,37 @@
 static struct rmixl_cpu_trampoline_args rmixl_cpu_trampoline_args;
 #endif
 
+/*
+ * cpu_xls616_erratum
+ *
+ * on the XLS616, COUNT/COMPARE clock regs seem to interact between
+ * threads on a core 
+ *
+ * the symptom of the error is retarded clock interrupts
+ * and very slow apparent system performance
+ *
+ * other XLS chips may have the same problem.
+ * we may need to add other PID checks.
+ */
+static inline bool
+cpu_xls616_erratum(device_t parent, struct cpucore_attach_args *ca)
+{
+	if (mips_options.mips_cpu->cpu_pid == MIPS_XLS616) {
+		if (ca->ca_thread > 0) {
+			aprint_error_dev(parent, "XLS616 CLOCK ERRATUM: "
+				"deconfigure cpu%d\n", ca->ca_thread);
+			return true;
+		}
+	}
+	return false;
+}
+
+static bool
+cpu_rmixl_erratum(device_t parent, struct cpucore_attach_args *ca)
+{
+	return cpu_xls616_erratum(parent, ca);
+}
+
 static int
 cpu_rmixl_match(device_t parent, cfdata_t cf, void *aux)
 {
@@ -103,7 +134,8 @@
 #ifndef MULTIPROCESSOR
 	    && ca->ca_thread == 0
 #endif
-	    && (thread == CPUCORECF_THREAD_DEFAULT || thread == ca->ca_thread))
+	    && (thread == CPUCORECF_THREAD_DEFAULT || thread == ca->ca_thread)
+	    && (!cpu_rmixl_erratum(parent, ca)))
 			return 1;
 
 	return 0;
@@ -115,6 +147,7 @@
 	struct rmixl_cpu_softc * const sc = device_private(self);
 	struct cpucore_attach_args *ca = aux;
 	struct cpu_info *ci = NULL;
+	extern void rmixl_spl_init_cpu(void);
 
 	if (ca->ca_thread == 0 && ca->ca_core == 0) {
 		ci = curcpu();
@@ -122,6 +155,7 @@
 		sc->sc_ci = ci;
 		ci->ci_softc = (void *)sc;
 
+		rmixl_spl_init_cpu();	/* spl initialization for CPU#0 */
 		cpu_rmixl_attach_once(sc);
 
 #ifdef MULTIPROCESSOR
@@ -130,9 +164,6 @@
 		struct cpucore_softc * const ccsc = device_private(parent);
 		rmixlfw_psb_type_t psb_type = rmixl_configuration.rc_psb_type;
 		cpuid_t cpuid;
-		int s;
-
-		s = splhigh();
 
 		KASSERT(ca->ca_core < 8);
 		KASSERT(ca->ca_thread < 4);
@@ -164,9 +195,6 @@
 			aprint_error(": failed to hatch\n");
 			return;
 		}
-
-		splx(s);
-
 #endif	/* MULTIPROCESSOR */
 	}
 
@@ -233,6 +261,10 @@
 void
 cpu_rmixl_hatch(struct cpu_info *ci)
 {
+	extern void rmixl_spl_init_cpu(void);
+
+	rmixl_spl_init_cpu();	/* spl initialization for this CPU */
+
 	(void)splhigh();
 
 #ifdef DEBUG

Reply via email to