From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 3/4] imx: mx6: add display of CPU temperature grade in print_cpuinfo()
Date: Fri, 15 May 2015 15:24:50 +0200 [thread overview]
Message-ID: <5555F3A2.9090906@denx.de> (raw)
In-Reply-To: <CAJ+vNU2OxN07TKcxQkw6GgGPY7gKdSXa-6-6YSXOEHiYT=dOcg@mail.gmail.com>
Hi Tim,
On 15/05/2015 15:16, Tim Harvey wrote:
> On Fri, May 15, 2015 at 1:14 AM, Christian Gmeiner
> <christian.gmeiner@gmail.com> wrote:
>> 2015-05-14 7:11 GMT+02:00 Tim Harvey <tharvey@gateworks.com>:
>>> When CONFIG_IMX6_THERMAL is defined print the CPU temperature grade info
>>> along with the current temperature.
>>>
>>> Before:
>>> CPU: Temperature 42 C
>>>
>>> After:
>>> CPU: Automotive temperature grade (-40C to 125C) at 42C
>>> CPU: Industiral temperature grade (-40C to 105C) at 42C
>>> CPU: Extended Commercial temperature grade (-20C to 105C) at 42C
>>>
>>> Signed-off-by: Tim Harvey <tharvey@gateworks.com>
>>> ---
>>> v2:
>>> - moved display of CPU temperature grade to own patch and combined with the
>>> current temperature from the thermal sensor driver
>>> - add example output to description
>>>
>>> Signed-off-by: Tim Harvey <tharvey@gateworks.com>
>>> ---
>>> arch/arm/imx-common/cpu.c | 27 +++++++++++++++++++++++----
>>> 1 file changed, 23 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/arch/arm/imx-common/cpu.c b/arch/arm/imx-common/cpu.c
>>> index 6b20482..f1b49bb 100644
>>> --- a/arch/arm/imx-common/cpu.c
>>> +++ b/arch/arm/imx-common/cpu.c
>>> @@ -16,6 +16,7 @@
>>> #include <asm/arch/clock.h>
>>> #include <asm/arch/sys_proto.h>
>>> #include <asm/arch/crm_regs.h>
>>> +#include <imx_thermal.h>
>>> #include <ipu_pixfmt.h>
>>> #include <thermal.h>
>>> #include <sata.h>
>>> @@ -146,7 +147,7 @@ int print_cpuinfo(void)
>>>
>>> #if defined(CONFIG_MX6) && defined(CONFIG_IMX6_THERMAL)
>>> struct udevice *thermal_dev;
>>> - int cpu_tmp, ret;
>>> + int cpu_tmp, minc, maxc, ret;
>>> #endif
>>>
>>> cpurev = get_cpu_rev();
>>> @@ -172,16 +173,34 @@ int print_cpuinfo(void)
>>> #endif
>>>
>>> #if defined(CONFIG_MX6) && defined(CONFIG_IMX6_THERMAL)
>>> + puts("CPU: ");
>>> + if (!is_cpu_type(MXC_CPU_MX6SX)) {
>>> + switch (get_cpu_temp_grade(&minc, &maxc)) {
>>> + case TEMP_AUTOMOTIVE:
>>> + puts("Automotive temperature grade ");
>>> + break;
>>> + case TEMP_INDUSTRIAL:
>>> + puts("Industrial temperature grade ");
>>> + break;
>>> + case TEMP_EXTCOMMERCIAL:
>>> + puts("Extended Commercial temperature grade ");
>>> + break;
>>> + default:
>>> + puts("Commercial temperature grade ");
>>> + break;
>>> + }
>>> + printf("(%dC to %dC)", minc, maxc);
>>> + }
>>
>> For the additions above we do not need CONFIG_IMX6_THERMAL.
>
> Hi Christian,
>
> Thanks for the review.
>
> Its true that CONFIG_IMX6_THERMAL is not needed for cpu temperature
> grade but I felt that there would be resistance in general to adding
> additional lines in print_cpuinfo without allowing them to be easily
> disabled.
Agree on this point.
> I felt that temperature grade and current temperature made
> sense to go together in this fasion.
>
> Looking over this though did remind me that now that Freescale has
> told me that the IMX6SX has the same OTP registers/definitions for
> temperature grade programmed I can remove the skip for MX6SX. I would
> however sure like to have someone with an actual MX6SX enable that
> code and give us some testing feedback.
>
Right. My proposal is to merge the currrent patchset, enabling for
IMX6SX again when someone will test it.
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
next prev parent reply other threads:[~2015-05-15 13:24 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-14 5:11 [U-Boot] [PATCH v2 0/4]: imx: mx6: use OTP for temperature grade info Tim Harvey
2015-05-14 5:11 ` [U-Boot] [PATCH v2 1/4] mx6: add OTP bank1 registers Tim Harvey
2015-05-15 8:08 ` Christian Gmeiner
2015-05-17 22:32 ` Nikolay Dimitrov
2015-05-14 5:11 ` [U-Boot] [PATCH v2 2/4] imx: mx6: add get_cpu_temp_grade to obtain cpu temperature grade from OTP Tim Harvey
2015-05-15 8:17 ` Christian Gmeiner
2015-05-17 22:33 ` Nikolay Dimitrov
2015-05-14 5:11 ` [U-Boot] [PATCH v2 3/4] imx: mx6: add display of CPU temperature grade in print_cpuinfo() Tim Harvey
2015-05-15 8:14 ` Christian Gmeiner
2015-05-15 13:16 ` Tim Harvey
2015-05-15 13:24 ` Stefano Babic [this message]
2015-05-15 13:31 ` Tim Harvey
2015-05-15 13:36 ` Fabio Estevam
2015-05-18 0:11 ` Peng Fan
2015-05-18 13:30 ` Tim Harvey
2015-05-15 13:44 ` Stefano Babic
2015-05-17 22:33 ` Nikolay Dimitrov
2015-05-14 5:11 ` [U-Boot] [PATCH v2 4/4] thermal: imx_thermal: use CPU temperature grade for trip points Tim Harvey
2015-05-17 22:34 ` Nikolay Dimitrov
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=5555F3A2.9090906@denx.de \
--to=sbabic@denx.de \
--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