From: Nikolay Dimitrov <picmaster@mail.bg>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/2] mx: mx6: display max cpu frequency in print_cpuinfo()
Date: Mon, 18 May 2015 00:38:35 +0300 [thread overview]
Message-ID: <55590A5B.1080305@mail.bg> (raw)
In-Reply-To: <1431580121-24726-3-git-send-email-tharvey@gateworks.com>
On 05/14/2015 08:08 AM, Tim Harvey wrote:
> Display the max CPU frequency as well as the current running CPU frequency
> if the max CPU frequency is available and differs from the current CPU
> frequency.
>
> Before:
> CPU: Freescale i.MX6Q rev1.2 at 792 MHz
>
> After - using an 800MHz IMX6DL (running at its max)
> CPU: Freescale i.MX6DL rev1.1 at 792 MHz
>
> After - using a 1GHz IMX6Q (not running at its max):
> CPU: Freescale i.MX6Q rev1.2 996 MHz (running at 792 MHz)
>
> Signed-off-by: Tim Harvey <tharvey@gateworks.com>
> ---
> v2:
> - split out from patch that obtains the max cpu freq
> - add before/after example and more description of change
>
> Signed-off-by: Tim Harvey <tharvey@gateworks.com>
> ---
> arch/arm/imx-common/cpu.c | 16 +++++++++++++++-
> 1 file changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/imx-common/cpu.c b/arch/arm/imx-common/cpu.c
> index 067d08f..6b20482 100644
> --- a/arch/arm/imx-common/cpu.c
> +++ b/arch/arm/imx-common/cpu.c
> @@ -142,7 +142,7 @@ const char *get_imx_type(u32 imxtype)
>
> int print_cpuinfo(void)
> {
> - u32 cpurev;
> + u32 cpurev, max_freq;
>
> #if defined(CONFIG_MX6) && defined(CONFIG_IMX6_THERMAL)
> struct udevice *thermal_dev;
> @@ -151,11 +151,25 @@ int print_cpuinfo(void)
>
> cpurev = get_cpu_rev();
>
> +#if defined(CONFIG_MX6)
> + printf("CPU: Freescale i.MX%s rev%d.%d",
> + get_imx_type((cpurev & 0xFF000) >> 12),
> + (cpurev & 0x000F0) >> 4,
> + (cpurev & 0x0000F) >> 0);
> + max_freq = get_cpu_speed_grade_hz();
> + if (!max_freq || max_freq == mxc_get_clock(MXC_ARM_CLK)) {
> + printf(" at %dMHz\n", mxc_get_clock(MXC_ARM_CLK) / 1000000);
> + } else {
> + printf(" %d MHz (running at %d MHz)\n", max_freq / 1000000,
> + mxc_get_clock(MXC_ARM_CLK) / 1000000);
> + }
> +#else
> printf("CPU: Freescale i.MX%s rev%d.%d at %d MHz\n",
> get_imx_type((cpurev & 0xFF000) >> 12),
> (cpurev & 0x000F0) >> 4,
> (cpurev & 0x0000F) >> 0,
> mxc_get_clock(MXC_ARM_CLK) / 1000000);
> +#endif
>
> #if defined(CONFIG_MX6) && defined(CONFIG_IMX6_THERMAL)
> ret = uclass_get_device(UCLASS_THERMAL, 0, &thermal_dev);
>
Tested-by: Nikolay Dimitrov <picmaster@mail.bg>
Regards,
Nikolay
prev parent reply other threads:[~2015-05-17 21:38 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-14 5:08 [U-Boot] [PATCH v2 0/2]: imx: mx6: use OTP for freq grade Tim Harvey
2015-05-14 5:08 ` [U-Boot] [PATCH v2 1/2] imx: mx6: add get_cpu_speed_grade_hz func to return MHz speed grade from OTP Tim Harvey
2015-05-15 7:53 ` Christian Gmeiner
2015-05-15 13:20 ` Stefano Babic
2015-05-15 14:26 ` Christian Gmeiner
2015-05-15 14:32 ` Stefano Babic
2015-05-15 19:54 ` Troy Kisky
2015-05-15 20:38 ` Tim Harvey
2015-05-15 20:43 ` Troy Kisky
2015-05-15 22:34 ` Troy Kisky
2015-05-15 22:57 ` Otavio Salvador
2015-05-15 23:24 ` Troy Kisky
2015-05-15 13:42 ` Tim Harvey
2015-05-17 21:37 ` Nikolay Dimitrov
2015-05-14 5:08 ` [U-Boot] [PATCH v2 2/2] mx: mx6: display max cpu frequency in print_cpuinfo() Tim Harvey
2015-05-17 21:38 ` Nikolay Dimitrov [this message]
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=55590A5B.1080305@mail.bg \
--to=picmaster@mail.bg \
--cc=u-boot@lists.denx.de \
/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