Re: PATCH][4/7] perfctr-2.7.2 for 2.6.6-mm2: PowerPC
From: Tom Rini
Date: Fri May 14 2004 - 13:11:08 EST
On Fri, May 14, 2004 at 04:11:39PM +0200, Mikael Pettersson wrote:
> perfctr-2.7.2 for 2.6.6-mm2, part 4/7:
[snip]
> --- linux-2.6.6-mm2/drivers/perfctr/ppc.c 1970-01-01 01:00:00.000000000 +0100
[snip]
> +#define SPRN_MMCR0 0x3B8 /* 604 and up */
[snip]
> +#define MMCR2_RESERVED (MMCR2_SMCNTEN | MMCR2_SMINTEN | MMCR2__RESERVED)
All of these belong in <asm-ppc/reg.h>.
[snip]
+static int __init generic_init(void)
> +{
> + static char generic_name[] __initdata = "PowerPC 60x/7xx/74xx";
> + unsigned int features;
> + enum pll_type pll_type;
> + unsigned int pvr;
> +
> + features = PERFCTR_FEATURE_RDTSC | PERFCTR_FEATURE_RDPMC;
> + pvr = mfspr(SPRN_PVR);
> + switch( PVR_VER(pvr) ) {
> + case 0x0004: /* 604 */
> + pm_type = PM_604;
> + pll_type = PLL_NONE;
> + features = PERFCTR_FEATURE_RDTSC;
> + break;
This should all be done with cputable bits I would think.
arch/ppc/kernel/cputable.c and include/asm-ppc/cputable.h
(CPU_FTR_PERFCTR_PLL_{NONE,604e,...) and then
if (cur_cpu_spec[i]->cpu_features & CPU_FTR_PERFCTL_PLL_NONE)
pll_type = PLL_NONE
Or might that be bigger, code wise, in the end?
--
Tom Rini
http://gate.crashing.org/~trini/
-
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/