Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Mar 2012 06:28:16 +0000 (UTC)
From:      Oleksandr Tymoshenko <gonzo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r233417 - head/sys/mips/cavium
Message-ID:  <201203240628.q2O6SGVp016760@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gonzo
Date: Sat Mar 24 06:28:15 2012
New Revision: 233417
URL: http://svn.freebsd.org/changeset/base/233417

Log:
  Remap PMC interrupt for all cores

Modified:
  head/sys/mips/cavium/octeon_irq.h
  head/sys/mips/cavium/octeon_machdep.c
  head/sys/mips/cavium/octeon_pmc.c

Modified: head/sys/mips/cavium/octeon_irq.h
==============================================================================
--- head/sys/mips/cavium/octeon_irq.h	Sat Mar 24 05:30:13 2012	(r233416)
+++ head/sys/mips/cavium/octeon_irq.h	Sat Mar 24 06:28:15 2012	(r233417)
@@ -176,4 +176,6 @@ typedef enum
     /* Interrupts 129 - 135 are reserved */
 } octeon_irq_t;
 
+#define	OCTEON_PMC_IRQ	OCTEON_IRQ_4
+
 #endif

Modified: head/sys/mips/cavium/octeon_machdep.c
==============================================================================
--- head/sys/mips/cavium/octeon_machdep.c	Sat Mar 24 05:30:13 2012	(r233416)
+++ head/sys/mips/cavium/octeon_machdep.c	Sat Mar 24 06:28:15 2012	(r233417)
@@ -260,6 +260,8 @@ octeon_debug_symbol(void)
 void
 octeon_ciu_reset(void)
 {
+	uint64_t cvmctl;
+
 	/* Disable all CIU interrupts by default */
 	cvmx_write_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num()*2), 0);
 	cvmx_write_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num()*2+1), 0);
@@ -272,6 +274,14 @@ octeon_ciu_reset(void)
 		       (1ull << (OCTEON_IRQ_MBOX0 - 8)) |
 		       (1ull << (OCTEON_IRQ_MBOX1 - 8)));
 #endif
+
+	/* 
+	 * Move the Performance Counter interrupt to OCTEON_PMC_IRQ
+	 */
+	cvmctl = mips_rd_cvmctl();
+	cvmctl &= ~(7 << 7);
+	cvmctl |= (OCTEON_PMC_IRQ + 2) << 7;
+	mips_wr_cvmctl(cvmctl);
 }
 
 static void

Modified: head/sys/mips/cavium/octeon_pmc.c
==============================================================================
--- head/sys/mips/cavium/octeon_pmc.c	Sat Mar 24 05:30:13 2012	(r233416)
+++ head/sys/mips/cavium/octeon_pmc.c	Sat Mar 24 06:28:15 2012	(r233417)
@@ -57,8 +57,6 @@ static int		octeon_pmc_probe(device_t);
 static int		octeon_pmc_attach(device_t);
 static int		octeon_pmc_intr(void *);
 
-#define	OCTEON_PMC_IRQ	4
-
 static void
 octeon_pmc_identify(driver_t *drv, device_t parent)
 {
@@ -82,7 +80,6 @@ octeon_pmc_attach(device_t dev)
 	struct octeon_pmc_softc *sc;
 	int error;
 	int rid;
-	uint64_t cvmctl;
 
 	sc = device_get_softc(dev);
 
@@ -103,14 +100,6 @@ octeon_pmc_attach(device_t dev)
 		return (error);
 	}
 
-	/* 
-	 * Move the Performance Counter interrupt to OCTEON_PMC_IRQ
-	 */
-	cvmctl = mips_rd_cvmctl();
-	cvmctl &= ~(7 << 7);
-	cvmctl |= (OCTEON_PMC_IRQ + 2) << 7;
-	mips_wr_cvmctl(cvmctl);
-
 	return (0);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203240628.q2O6SGVp016760>