From 28420e780ab5b1bf4bd76ed04313b86ffc4ea17e Mon Sep 17 00:00:00 2001 From: Prabhakar Kushwaha Date: Mon, 18 May 2015 17:13:52 +0530 Subject: arm/imx-common: Fix warning 'get_reset_cause' defined but not used MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix below warning arch/arm/imx-common/cpu.c:29:14: warning: ‘get_reset_cause’ defined but not used static char *get_reset_cause(void) Signed-off-by: Prabhakar Kushwaha Reviewed-by: Eric Nelson Acked-by: Stefano Babic --- arch/arm/imx-common/cpu.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch/arm/imx-common/cpu.c') diff --git a/arch/arm/imx-common/cpu.c b/arch/arm/imx-common/cpu.c index 067d08f..0cd08cb 100644 --- a/arch/arm/imx-common/cpu.c +++ b/arch/arm/imx-common/cpu.c @@ -24,6 +24,7 @@ #include #endif +#if defined(CONFIG_DISPLAY_CPUINFO) static u32 reset_cause = -1; static char *get_reset_cause(void) @@ -60,6 +61,7 @@ u32 get_imx_reset_cause(void) { return reset_cause; } +#endif #if defined(CONFIG_MX53) || defined(CONFIG_MX6) #if defined(CONFIG_MX53) -- cgit v1.1 From b83ddac80553ae001b4daa412e386e00d45d0bbb Mon Sep 17 00:00:00 2001 From: Tim Harvey Date: Mon, 18 May 2015 07:02:25 -0700 Subject: imx: mx6: display max cpu frequency in print_cpuinfo() 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) Cc: Stefan Roese Cc: Eric Nelson Cc: Heiko Schocher Cc: Nikita Kiryanov Cc: Jon Nettleton Cc: Jason Liu Cc: Ye Li Cc: Fabio Estevam Cc: Christian Gmeiner Cc: Markus Niebel Cc: Peng Fan Tested-by: Nikolay Dimitrov Signed-off-by: Tim Harvey --- arch/arm/imx-common/cpu.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'arch/arm/imx-common/cpu.c') diff --git a/arch/arm/imx-common/cpu.c b/arch/arm/imx-common/cpu.c index 0cd08cb..37472ea 100644 --- a/arch/arm/imx-common/cpu.c +++ b/arch/arm/imx-common/cpu.c @@ -144,7 +144,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; @@ -153,11 +153,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); -- cgit v1.1 From 70caa8e21d3e2393571981631f9b87c253e2ac29 Mon Sep 17 00:00:00 2001 From: Tim Harvey Date: Mon, 18 May 2015 06:56:46 -0700 Subject: 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 Cc: Eric Nelson Cc: Heiko Schocher Cc: Nikita Kiryanov Cc: Jon Nettleton Cc: Jason Liu Cc: Ye Li Cc: Fabio Estevam Cc: Christian Gmeiner Cc: Markus Niebel Cc: Peng Fan Tested-by: Nikolay Dimitrov Signed-off-by: Tim Harvey --- arch/arm/imx-common/cpu.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'arch/arm/imx-common/cpu.c') diff --git a/arch/arm/imx-common/cpu.c b/arch/arm/imx-common/cpu.c index 37472ea..275befd 100644 --- a/arch/arm/imx-common/cpu.c +++ b/arch/arm/imx-common/cpu.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -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 -- cgit v1.1