]> 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 a39e053c570c486800ae64deacb15c9307e2899a..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 <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>
 #include <ipu_pixfmt.h>
 #include <thermal.h>
 #include <sata.h>
@@ -24,6 +25,7 @@
 #include <fsl_esdhc.h>
 #endif
 
 #include <fsl_esdhc.h>
 #endif
 
+#if defined(CONFIG_DISPLAY_CPUINFO)
 static u32 reset_cause = -1;
 
 static char *get_reset_cause(void)
 static u32 reset_cause = -1;
 
 static char *get_reset_cause(void)
@@ -60,6 +62,7 @@ u32 get_imx_reset_cause(void)
 {
        return reset_cause;
 }
 {
        return reset_cause;
 }
+#endif
 
 #if defined(CONFIG_SOC_MX53) || defined(CONFIG_SOC_MX6)
 #if defined(CONFIG_SOC_MX53)
 
 #if defined(CONFIG_SOC_MX53) || defined(CONFIG_SOC_MX6)
 #if defined(CONFIG_SOC_MX53)
@@ -119,6 +122,10 @@ unsigned imx_ddr_size(void)
 const char *get_imx_type(u32 imxtype)
 {
        switch (imxtype) {
 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:
        case MXC_CPU_MX6Q:
                return "6Q";    /* Quad-core version of the mx6 */
        case MXC_CPU_MX6D:
@@ -131,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 */
                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:
        case MXC_CPU_MX51:
                return "51";
        case MXC_CPU_MX53:
@@ -143,31 +152,61 @@ const char *get_imx_type(u32 imxtype)
 int print_cpuinfo(void)
 {
        u32 cpurev;
 int print_cpuinfo(void)
 {
        u32 cpurev;
+       __maybe_unused u32 max_freq;
 
 #if defined(CONFIG_SOC_MX6) && defined(CONFIG_IMX6_THERMAL)
        struct udevice *thermal_dev;
 
 #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();
 
 #endif
 
        cpurev = get_cpu_rev();
 
+#if defined(CONFIG_SOC_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);
        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_SOC_MX6) && defined(CONFIG_IMX6_THERMAL)
 
 #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)
        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
                else
-                       printf("CPU:   Temperature: invalid sensor data\n");
+                       puts(" - invalid sensor data\n");
        } else {
        } else {
-               printf("CPU:   Temperature: Can't find sensor device\n");
+               puts(" - invalid sensor device\n");
        }
 #endif
 
        }
 #endif
 
@@ -180,7 +219,7 @@ int cpu_eth_init(bd_t *bis)
 {
        int rc = -ENODEV;
 
 {
        int rc = -ENODEV;
 
-#if defined(CONFIG_FEC_MXC)
+#if defined(CONFIG_FEC_MXC) && defined(CONFIG_FEC_MXC_PHYADDR)
        rc = fecmxc_initialize(bis);
 #endif
 
        rc = fecmxc_initialize(bis);
 #endif