mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tom Rini <trini@kernel.crashing.org>
To: Mikael Pettersson <mikpe@csd.uu.se>
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: PATCH][4/7] perfctr-2.7.2 for 2.6.6-mm2: PowerPC
Date: Fri, 14 May 2004 11:07:06 -0700	[thread overview]
Message-ID: <20040514180706.GR2196@smtp.west.cox.net> (raw)
In-Reply-To: <200405141411.i4EEBdvW018419@alkaid.it.uu.se>

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/

  reply	other threads:[~2004-05-14 18:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-14 14:11 Mikael Pettersson
2004-05-14 18:07 ` Tom Rini [this message]
2004-05-15 14:37   ` Mikael Pettersson
2004-05-17 17:23     ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040514180706.GR2196@smtp.west.cox.net \
    --to=trini@kernel.crashing.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikpe@csd.uu.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®