[PATCH][2.6.9-mm1] perfctr ppc32 update

From: Mikael Pettersson
Date: Sun Oct 24 2004 - 09:27:19 EST


Andrew,

This patch is an update to perfctr's PPC32 low-level driver:
- Add support for the MPC7447A processor.
- Add partial support for the new MPC7448 processor.
PLL_CFG decoding not yet implemented due to lack of docs.
- Enable overflow interrupt support on all G4 processors except
those with the DEC/TAU/PMI erratum.
- Wrap thread_struct's perfctr pointer in an #ifdef to avoid
bloat when perfctr is disabled. This was requested by some
users in the PPC32 embedded world.

Signed-off-by: Mikael Pettersson <mikpe@xxxxxxxxx>

drivers/perfctr/ppc.c | 20 +++++++++++---------
include/asm-ppc/processor.h | 2 ++
2 files changed, 13 insertions(+), 9 deletions(-)

diff -rupN linux-2.6.9-mm1/drivers/perfctr/ppc.c linux-2.6.9-mm1.perfctr-ppc32-update/drivers/perfctr/ppc.c
--- linux-2.6.9-mm1/drivers/perfctr/ppc.c 2004-10-24 01:06:08.000000000 +0200
+++ linux-2.6.9-mm1.perfctr-ppc32-update/drivers/perfctr/ppc.c 2004-10-24 02:07:44.000000000 +0200
@@ -1,4 +1,4 @@
-/* $Id: ppc.c,v 1.12 2004/05/31 18:13:42 mikpe Exp $
+/* $Id: ppc.c,v 1.27 2004/10/24 00:07:44 mikpe Exp $
* PPC32 performance-monitoring counters driver.
*
* Copyright (C) 2004 Mikael Pettersson
@@ -149,14 +149,6 @@ static inline int perfctr_cstatus_has_mm
* doing this (a) reserves one PMC, and (b) needs indirect accesses
* since the SPR number in general isn't known at compile-time.
*
- * Driver notes
- * ------------
- * - The driver currently does not support performance monitor interrupts,
- * mostly because of the 750/7400/7410 erratum. Working around it would
- * require disabling the decrementer interrupt, reserving a performance
- * counter and setting it up for TBL bit-flip events, and having the PMI
- * handler invoke the decrementer handler.
- *
* 604
* ---
* 604 has MMCR0, PMC1, PMC2, SIA, and SDA.
@@ -903,10 +895,13 @@ static int __init known_init(void)
pll_type = PLL_7400;
break;
case 0x800C: /* 7410 */
+ if ((pvr & 0xFFFF) >= 0x1103)
+ features |= PERFCTR_FEATURE_PCINT;
pm_type = PM_7400;
pll_type = PLL_7400;
break;
case 0x8000: /* 7451/7441 */
+ features |= PERFCTR_FEATURE_PCINT;
pm_type = PM_7450;
pll_type = PLL_7450;
break;
@@ -916,9 +911,16 @@ static int __init known_init(void)
pll_type = ((pvr & 0xFFFF) < 0x0303) ? PLL_7450 : PLL_7457;
break;
case 0x8002: /* 7457/7447 */
+ case 0x8003: /* 7447A */
+ features |= PERFCTR_FEATURE_PCINT;
pm_type = PM_7450;
pll_type = PLL_7457;
break;
+ case 0x8004: /* 7448 */
+ features |= PERFCTR_FEATURE_PCINT;
+ pm_type = PM_7450;
+ pll_type = PLL_NONE; /* known to differ from 7447A, no details yet */
+ break;
default:
return -ENODEV;
}
diff -rupN linux-2.6.9-mm1/include/asm-ppc/processor.h linux-2.6.9-mm1.perfctr-ppc32-update/include/asm-ppc/processor.h
--- linux-2.6.9-mm1/include/asm-ppc/processor.h 2004-10-24 01:06:17.000000000 +0200
+++ linux-2.6.9-mm1.perfctr-ppc32-update/include/asm-ppc/processor.h 2004-10-24 14:51:02.811634000 +0200
@@ -126,7 +126,9 @@ struct thread_struct {
unsigned long spefscr; /* SPE & eFP status */
int used_spe; /* set if process has used spe */
#endif /* CONFIG_SPE */
+#ifdef CONFIG_PERFCTR_VIRTUAL
struct vperfctr *perfctr; /* performance counters */
+#endif
};

#define ARCH_MIN_TASKALIGN 16
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/