summaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorTim Harvey <tharvey@gateworks.com>2015-05-18 06:56:46 -0700
committerStefano Babic <sbabic@denx.de>2015-05-19 15:31:46 +0200
commit70caa8e21d3e2393571981631f9b87c253e2ac29 (patch)
tree68dd5e1f0ce189981774461c40dd5c01f55045da /arch/arm
parentf0e8e8944dc9bdddd0e3e3b7dbd8ac76008b32a4 (diff)
imx: mx6: add display of CPU temperature grade in print_cpuinfo()
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: Industrial temperature grade (-40C to 105C) at 42C CPU: Extended Commercial temperature grade (-20C to 105C) at 42C Cc: Stefan Roese <sr@denx.de> Cc: Eric Nelson <eric.nelson@boundarydevices.com> Cc: Heiko Schocher <hs@denx.de> Cc: Nikita Kiryanov <nikita@compulab.co.il> Cc: Jon Nettleton <jon.nettleton@gmail.com> Cc: Jason Liu <r64343@freescale.com> Cc: Ye Li <b37916@freescale.com> Cc: Fabio Estevam <fabio.estevam@freescale.com> Cc: Christian Gmeiner <christian.gmeiner@gmail.com> Cc: Markus Niebel <Markus.Niebel@tq-group.com> Cc: Peng Fan <b51431@freescale.com> Tested-by: Nikolay Dimitrov <picmaster@mail.bg> Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/imx-common/cpu.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/arch/arm/imx-common/cpu.c b/arch/arm/imx-common/cpu.c
index 37472eadfc..275befd2f8 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>
@@ -148,7 +149,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();
@@ -174,16 +175,32 @@ int print_cpuinfo(void)
#endif
#if defined(CONFIG_MX6) && defined(CONFIG_IMX6_THERMAL)
+ puts("CPU: ");
+ 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);
ret = uclass_get_device(UCLASS_THERMAL, 0, &thermal_dev);
if (!ret) {
ret = thermal_get_temp(thermal_dev, &cpu_tmp);
if (!ret)
- printf("CPU: Temperature %d C\n", cpu_tmp);
+ printf(" at %dC\n", cpu_tmp);
else
- printf("CPU: Temperature: invalid sensor data\n");
+ puts(" - invalid sensor data\n");
} else {
- printf("CPU: Temperature: Can't find sensor device\n");
+ puts(" - invalid sensor device\n");
}
#endif