ARM: tegra: clock: Fix speedo_id eval for max speedo value
Diwakar Tundlam [Fri, 20 May 2011 23:51:48 +0000 (16:51 -0700)]
Original-Change-Id: Ia36ea70b054262772df39650b5fdc7419be2bfcf
Reviewed-on: http://git-master/r/32802
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
Tested-by: Diwakar Tundlam <dtundlam@nvidia.com>
Reviewed-by: Aleksandr Frid <afrid@nvidia.com>
Reviewed-by: Scott Williams <scwilliams@nvidia.com>

Rebase-Id: R90d4deb23bca5ba6bad270c6c6eb54a851ae6a6f

arch/arm/mach-tegra/fuse.c
arch/arm/mach-tegra/include/mach/edp.h
arch/arm/mach-tegra/tegra3_speedo.c

index 61bbac3..5ef69f2 100644 (file)
 
 static const char *tegra_revision_name[TEGRA_REVISION_MAX] = {
        [TEGRA_REVISION_UNKNOWN] = "unknown",
-#if defined(CONFIG_ARCH_TEGRA_2x_SOC)
+#if !defined(CONFIG_ARCH_TEGRA_2x_SOC)
+       [TEGRA_REVISION_A01] = "A01",
+#endif
        [TEGRA_REVISION_A02] = "A02",
+#if defined(CONFIG_ARCH_TEGRA_2x_SOC)
        [TEGRA_REVISION_A03] = "A03",
        [TEGRA_REVISION_A03p] = "A03 prime",
-#elif defined(CONFIG_ARCH_TEGRA_3x_SOC)
-       [TEGRA_REVISION_A01] = "A01",
 #endif
 };
 
index 8401e20..21a56eb 100644 (file)
@@ -23,7 +23,7 @@
 
 struct tegra_edp_limits {
        int     temperature;
-       unsigned int freq_limits[CONFIG_NR_CPUS];
+       unsigned int freq_limits[4];
 };
 
 #ifdef CONFIG_TEGRA_EDP_LIMITS
index a46cae1..4dcda7b 100644 (file)
@@ -110,13 +110,13 @@ void tegra_init_speedo_data(void)
        pr_debug("%s CPU speedo value %u\n", __func__, cpu_speedo_val);
        pr_debug("%s Core speedo value %u\n", __func__, core_speedo_val);
 
-       cpu_process_id = -1; // out of range for valid cpu-speedo
        for (iv = 0; iv < PROCESS_CORNERS_NUM; iv++) {
                if (cpu_speedo_val < cpu_process_speedos[soc_speedo_id][iv]) {
-                       cpu_process_id = iv -1;
                        break;
                }
        }
+       cpu_process_id = iv -1;
+
        if (cpu_process_id == -1) {
                pr_err("****************************************************");
                pr_err("****************************************************");
@@ -128,13 +128,13 @@ void tegra_init_speedo_data(void)
                cpu_process_id = INVALID_PROCESS_ID;
        }
 
-       core_process_id = -1; // out of range for valid core-speedo
        for (iv = 0; iv < PROCESS_CORNERS_NUM; iv++) {
                if (core_speedo_val < core_process_speedos[soc_speedo_id][iv]) {
-                       core_process_id = iv -1;
                        break;
                }
        }
+       core_process_id = iv -1;
+
        if (core_process_id == -1) {
                pr_err("*****************************************************");
                pr_err("*****************************************************");