]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/arm/imx-common/cpu.c
arm: imx: prevent build error when CONFIG_FEC_MXC_PHYADDR is undefined
[karo-tx-uboot.git] / arch / arm / imx-common / cpu.c
index b8b890b4769749d5eceebe44c7a76a8fa0019707..caa6ef6296159769574b4568cee28e479d2d742d 100644 (file)
@@ -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>
@@ -121,6 +122,10 @@ unsigned imx_ddr_size(void)
 const char *get_imx_type(u32 imxtype)
 {
        switch (imxtype) {
+       case MXC_CPU_MX6QP:
+               return "6QP";   /* Quad-Plus version of the mx6 */
+       case MXC_CPU_MX6DP:
+               return "6DP";   /* Dual-Plus version of the mx6 */
        case MXC_CPU_MX6Q:
                return "6Q";    /* Quad-core version of the mx6 */
        case MXC_CPU_MX6D:
@@ -133,6 +138,8 @@ const char *get_imx_type(u32 imxtype)
                return "6SL";   /* Solo-Lite version of the mx6 */
        case MXC_CPU_MX6SX:
                return "6SX";   /* SoloX version of the mx6 */
+       case MXC_CPU_MX6UL:
+               return "6UL";   /* Ultra-Lite version of the mx6 */
        case MXC_CPU_MX51:
                return "51";
        case MXC_CPU_MX53:
@@ -144,16 +151,17 @@ const char *get_imx_type(u32 imxtype)
 
 int print_cpuinfo(void)
 {
-       u32 cpurev, max_freq;
+       u32 cpurev;
+       __maybe_unused u32 max_freq;
 
 #if defined(CONFIG_SOC_MX6) && defined(CONFIG_IMX6_THERMAL)
        struct udevice *thermal_dev;
-       int cpu_tmp, ret;
+       int cpu_tmp, minc, maxc, ret;
 #endif
 
        cpurev = get_cpu_rev();
 
-#if defined(CONFIG_MX6)
+#if defined(CONFIG_SOC_MX6)
        printf("CPU:   Freescale i.MX%s rev%d.%d",
               get_imx_type((cpurev & 0xFF000) >> 12),
               (cpurev & 0x000F0) >> 4,
@@ -174,16 +182,31 @@ int print_cpuinfo(void)
 #endif
 
 #if defined(CONFIG_SOC_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 ");
+       }
+       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
 
@@ -196,7 +219,7 @@ int cpu_eth_init(bd_t *bis)
 {
        int rc = -ENODEV;
 
-#if defined(CONFIG_FEC_MXC)
+#if defined(CONFIG_FEC_MXC) && defined(CONFIG_FEC_MXC_PHYADDR)
        rc = fecmxc_initialize(bis);
 #endif