]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
show clk rates in print_cpuinfo()
authorLothar Waßmann <LW@KARO-electronics.de>
Mon, 30 Jul 2012 07:20:07 +0000 (09:20 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Mon, 30 Jul 2012 07:20:07 +0000 (09:20 +0200)
arch/arm/cpu/armv7/am33xx/sys_info.c

index 507b6180e62f1afc500bd11e1dd10c5730097414..f42bea64aad353e70fcf830ae8fbf5c5f5c9d546 100644 (file)
@@ -71,7 +71,7 @@ u32 get_board_rev(void)
 u32 get_device_type(void)
 {
        int mode;
-       mode = readl(&cstat->statusreg) & (DEVICE_MASK);
+       mode = readl(&cstat->statusreg) & DEVICE_MASK;
        return mode >>= 8;
 }
 
@@ -92,15 +92,15 @@ u32 get_sysboot_value(void)
 int print_cpuinfo(void)
 {
        char *cpu_s, *sec_s;
-       int arm_freq, ddr_freq;
+       unsigned long clk;
+       const struct cm_wkuppll *cmwkup = (struct cm_wkuppll *)CM_WKUP;
 
        switch (get_cpu_type()) {
-       case AM335X:
+       case AM335X_ID:
                cpu_s = "AM335X";
                break;
        default:
                cpu_s = "Unknown cpu type";
-               break;
        }
 
        switch (get_device_type()) {
@@ -120,10 +120,24 @@ int print_cpuinfo(void)
                sec_s = "?";
        }
 
-       printf("AM%s-%s rev %d\n",
+       printf("%s-%s rev %d\n",
                        cpu_s, sec_s, get_cpu_rev());
 
        /* TODO: Print ARM and DDR frequencies  */
+       clk = clk_get_rate(cmwkup, mpu);
+       printf("MPU clk: %lu.%03luMHz\n",
+               clk / 1000000, clk / 1000 % 1000);
+       clk = clk_get_rate(cmwkup, ddr);
+       printf("DDR clk: %lu.%03luMHz\n",
+               clk / 1000000, clk / 1000 % 1000);
+       clk = clk_get_rate(cmwkup, per);
+       printf("PER clk: %lu.%03luMHz\n",
+               clk / 1000000, clk / 1000 % 1000);
+#ifdef CONFIG_LCD
+       clk = clk_get_rate(cmwkup, disp);
+       printf("LCD clk: %lu.%03luMHz\n",
+               clk / 1000000, clk / 1000 % 1000);
+#endif
 
        return 0;
 }