[U-Boot] [imx PATCH v2] Add i.MX6 CPU temperature sensor support

Fabio Estevam festevam at gmail.com
Mon Sep 1 16:03:29 CEST 2014


Hi Nitin,

On Mon, Sep 1, 2014 at 12:25 AM, Nitin Garg <nitin.garg at freescale.com> wrote:
> i.MX6 SoC has onChip temperature sensor. Add support
> for this sensor.
>
> Signed-off-by: Nitin Garg <nitin.garg at freescale.com>
> ---
>
>  arch/arm/cpu/armv7/mx6/soc.c             |  142 +++++++-
>  arch/arm/imx-common/cpu.c                |    7 +-
>  arch/arm/include/asm/arch-mx6/crm_regs.h |  543 +++++++++++++++++++++++++++++-
>  arch/arm/include/asm/arch-mx6/imx-regs.h |    9 +-
>  include/configs/mx6sabre_common.h        |    1 +

Looks better, but I would split this patch in 2:

1/2 that adds the mx6 temperature support
2/2 that adds the mx6 temperature support to mx6sabresd board.

> +void check_cpu_temperature(void)
> +{
> +       int cpu_tmp = 0;
> +
> +       cpu_tmp = read_cpu_temperature();
> +       while (cpu_tmp > TEMPERATURE_MIN && cpu_tmp < TEMPERATURE_MAX) {
> +               if (cpu_tmp >= TEMPERATURE_HOT) {
> +                       printf("CPU is %d C, too hot to boot, waiting...\n",
> +                              cpu_tmp);
> +                       udelay(5000000);
> +                       cpu_tmp = read_cpu_temperature();
> +               } else {
> +                       break;
> +               }
> +       }
> +       if (cpu_tmp > TEMPERATURE_MIN && cpu_tmp < TEMPERATURE_MAX)
> +               printf("CPU:   Temperature %d C, calibration data: 0x%x\n",
> +                      cpu_tmp, fuse);

The temperature is useful information to display, but this calibration
data is just noise to have it displayed on every boot.

Could you please change this to only print the temperature?

Thanks


More information about the U-Boot mailing list