]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - arch/arm/imx-common/cpu.c
imx: mx6: display max cpu frequency in print_cpuinfo()
[karo-tx-uboot.git] / arch / arm / imx-common / cpu.c
index 2e7f6d1a11d4a0cde2dcb221b8b59dafba46c128..b8b890b4769749d5eceebe44c7a76a8fa0019707 100644 (file)
@@ -144,7 +144,7 @@ const char *get_imx_type(u32 imxtype)
 
 int print_cpuinfo(void)
 {
-       u32 cpurev;
+       u32 cpurev, max_freq;
 
 #if defined(CONFIG_SOC_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_SOC_MX6) && defined(CONFIG_IMX6_THERMAL)
        ret = uclass_get_device(UCLASS_THERMAL, 0, &thermal_dev);