]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
sh: perf: Support SH-X3 hardware counters.
authorPaul Mundt <lethal@linux-sh.org>
Tue, 12 Oct 2010 22:17:03 +0000 (07:17 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Tue, 12 Oct 2010 22:17:03 +0000 (07:17 +0900)
The PMCAT location has conveniently moved on newer SH-X3 parts, special
case this for now with a note. This will probably want to be redone in a
less visually offensive way when/if more information becomes available.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/kernel/cpu/sh4a/perf_event.c

index eddc21973fa1e4f4f5600d217503924c6ce0d88b..b8b873d8d6b515e49c46cb015f1f079241bcc73a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Performance events support for SH-4A performance counters
  *
- *  Copyright (C) 2009  Paul Mundt
+ *  Copyright (C) 2009, 2010  Paul Mundt
  *
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
 #define CCBR_CMDS      (1 << 1)
 #define CCBR_PPCE      (1 << 0)
 
+#ifdef CONFIG_CPU_SHX3
+/*
+ * The PMCAT location for SH-X3 CPUs was quietly moved, while the CCBR
+ * and PMCTR locations remains tentatively constant. This change remains
+ * wholly undocumented, and was simply found through trial and error.
+ *
+ * Early cuts of SH-X3 still appear to use the SH-X/SH-X2 locations, and
+ * it's unclear when this ceased to be the case. For now we always use
+ * the new location (if future parts keep up with this trend then
+ * scanning for them at runtime also remains a viable option.)
+ *
+ * The gap in the register space also suggests that there are other
+ * undocumented counters, so this will need to be revisited at a later
+ * point in time.
+ */
+#define PPC_PMCAT      0xfc100240
+#else
 #define PPC_PMCAT      0xfc100080
+#endif
 
 #define PMCAT_OVF3     (1 << 27)
 #define PMCAT_CNN3     (1 << 26)