linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: print cpu frequency in /proc/cpuinfo
Date: Fri, 13 Dec 2013 10:36:32 +0000	[thread overview]
Message-ID: <20131213103632.GC19177@mudshark.cambridge.arm.com> (raw)
In-Reply-To: <1386924222-23169-1-git-send-email-vkale@apm.com>

On Fri, Dec 13, 2013 at 08:43:42AM +0000, Vinayak Kale wrote:
> Print the cpu frequency field in /proc/cpuinfo.

Why? ["x86 does this" isn't a valid answer :)].

> Signed-off-by: Vinayak Kale <vkale@apm.com>
> ---
>  arch/arm64/kernel/setup.c |   15 +++++++++++++++
>  1 files changed, 15 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
> index bd9bbd0..bca982b 100644
> --- a/arch/arm64/kernel/setup.c
> +++ b/arch/arm64/kernel/setup.c
> @@ -41,6 +41,7 @@
>  #include <linux/memblock.h>
>  #include <linux/of_fdt.h>
>  #include <linux/of_platform.h>
> +#include <linux/cpufreq.h>
>  
>  #include <asm/cputype.h>
>  #include <asm/elf.h>
> @@ -278,9 +279,19 @@ static const char *hwcap_str[] = {
>  	NULL
>  };
>  
> +static unsigned int get_cpufreq_khz(unsigned int cpu)
> +{
> +#ifdef CONFIG_CPU_FREQ
> +	return cpufreq_quick_get(cpu);
> +#else
> +	return 0;
> +#endif
> +}

That's going to be hilarious fun when cpufreq isn't compiled in.
Just use the existing sysfs interfaces exposed by the cpufreq governers if
you need to know this stuff.

Will

  reply	other threads:[~2013-12-13 10:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-13  8:43 [PATCH] arm64: print cpu frequency in /proc/cpuinfo Vinayak Kale
2013-12-13 10:36 ` Will Deacon [this message]
2013-12-13 13:12   ` Vinayak Kale
2013-12-13 14:16   ` Rob Herring
2013-12-13 14:24     ` Russell King - ARM Linux
2013-12-13 15:13       ` Rob Herring
2013-12-16  5:13     ` Vinayak Kale

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=20131213103632.GC19177@mudshark.cambridge.arm.com \
    --to=will.deacon@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).