CPU frequency limit - hardware or software?

668 views
Skip to first unread message

cnyk

unread,
May 3, 2013, 10:50:11 AM5/3/13
to android...@googlegroups.com
Hi,
I'm asking about Samsung GT-I8160 phone. It has NovaThor U8500 chipset and should run at 1GHz CPU speed but it's limited by Samsung to 800MHz.
I've compared kernels source code with GT-I9070 and GT-I8190 (they have same chipset but 1GHz) and that's what I found:

All three devices have the same frequency table declared in /arch/arm/mach-ux500/devices-db8500.c file and for all three devices max frequency there is 800MHz.

static struct cpufreq_frequency_table db8500_freq_table[] = {
        [0] = {
                .index = 0,
                .frequency = 200000,
        },
        [1] = {
                .index = 1,
                .frequency = 400000,
        },
        [2] = {
                .index = 2,
                .frequency = 800000,
        },
        #if defined(CONFIG_MACH_GAVINI)
        [3] = {
                /* Used for MAX_OPP, if available */
                .index = 3,
                .frequency = 1000000,
        },
        #else
        [3] = {
                .index = 3,
                .frequency = CPUFREQ_TABLE_END,
        },
        #endif
        [4] = {
                .index = 4,
                .frequency = CPUFREQ_TABLE_END,
        },
};
struct platform_device db8500_prcmu_device = {
        .name                        = "db8500-prcmu",
        .dev = {
                .platform_data = db8500_freq_table,
        },
};

The frequency table is modified by PRCMU driver

/* /drivers/mfd/db8500-prcmu.c */
 
static void  db8500_prcmu_update_freq(void *pdata)
{
        freq_table =
                (struct cpufreq_frequency_table *)pdata;
        if  (!db8500_prcmu_has_arm_maxopp())
                return;
        switch (fw_info.version.project) {
        case PRCMU_FW_PROJECT_U8500:
        case PRCMU_FW_PROJECT_U9500:
        case PRCMU_FW_PROJECT_U8420:
        case PRCMU_FW_PROJECT_U8420_SYSCLK:
        case PRCMU_FW_PROJECT_A9420:
        case PRCMU_FW_PROJECT_U8500_MBL:
                freq_table[3].frequency = 1000000;
                break;
        case PRCMU_FW_PROJECT_U8500_C2:
        case PRCMU_FW_PROJECT_U8520:
                freq_table[3].frequency = 1150000;
                break;
        default:
                break;
        }
}

Unfortunately, db8500_prcmu_has_arm_maxopp function on my device returns false.

/* Index of different voltages to be used when accessing AVSData */
#define PRCM_AVS_BASE                0x2FC
#define PRCM_AVS_VARM_MAX_OPP        (PRCM_AVS_BASE + 0x4)
 
static bool db8500_prcmu_has_arm_maxopp(void)
{
        return (readb(tcdm_base + PRCM_AVS_VARM_MAX_OPP) &
                PRCM_AVS_ISMODEENABLE_MASK) == PRCM_AVS_ISMODEENABLE_MASK;
}

So, does it mean that it's hardware limit or software? Is there any chance to set CPU frequency to 1GHz?
Greetings, Michal.

Jeremy Morales

unread,
May 3, 2013, 11:10:05 AM5/3/13
to android...@googlegroups.com
I would say that it probably could run at 1ghz after you fixed the kernel.




--
--
unsubscribe: android-kerne...@googlegroups.com
website: http://groups.google.com/group/android-kernel
---
You received this message because you are subscribed to the Google Groups "Android Linux Kernel Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-kerne...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Michał Nykiel

unread,
May 3, 2013, 11:22:05 AM5/3/13
to android...@googlegroups.com
Do you mean remove db8500_prcmu_has_arm_maxopp() condition?


2013/5/3 Jeremy Morales <ajaxx...@gmail.com>
You received this message because you are subscribed to a topic in the Google Groups "Android Linux Kernel Development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-kernel/p4TTRop0OQA/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to android-kerne...@googlegroups.com.

Jeremy Morales

unread,
May 3, 2013, 12:03:25 PM5/3/13
to android...@googlegroups.com
Here is an example of implimenting overclocking in the Tegra kernel from the kernel I work with.
 static struct clk_pll_freq_table tegra_pll_x_freq_table[] = {
+  /* 1.7 GHz */
+   { 12000000, 1700000000, 800, 6, 1, 12},
+   { 13000000, 1700000000, 985, 8, 1, 12},
+   { 19200000, 1700000000, 1000, 12, 1, 8},
+   { 26000000, 1700000000, 800, 13, 1, 12},
+
+  /* 1.6 GHz */
+   { 12000000, 1600000000, 800, 6, 1, 12},
+   { 13000000, 1600000000, 985, 8, 1, 12},
+   { 19200000, 1600000000, 1000, 12, 1, 8},
+   { 26000000, 1600000000, 800, 13, 1, 12},
+
+  /* 1.504 GHz */
+   { 12000000, 1504000000, 752, 6, 1, 12},
+   { 13000000, 1504000000, 926, 8, 1, 12},
+   { 19200000, 1504000000, 940, 12, 1, 8},
+   { 26000000, 1504000000, 752, 13, 1, 12},
+
+  /* 1.4 GHz */
+   { 12000000, 1400000000, 700, 6, 1, 12},
+   { 13000000, 1400000000, 969, 9, 1, 12},
+   { 19200000, 1400000000, 875, 12, 1, 8},
+   { 26000000, 1400000000, 700, 13, 1, 12},
+
   /* 1.2 GHz */
   { 12000000, 1200000000, 600,  6,  1, 12},
   { 13000000, 1200000000, 923,  10, 1, 12},

Emeric VIGIER

unread,
May 3, 2013, 8:23:58 PM5/3/13
to android...@googlegroups.com
I can confirm U8500 is 1GHz capable.
But it depends on samples baked from the factory... Samples are sorted according to their performance. AVS registers are "burnt" accordingly.
Have a look at AVS to understand the risk you take by "overclocking" your phone.

Even after bypassing db8500_prcmu_has_arm_maxopp function, it might be possible that the PRCMU firmware won't clock it to 1GHz.

Emeric

Glenn Kasten

unread,
May 3, 2013, 9:52:57 PM5/3/13
to android...@googlegroups.com
Just wanted to echo the "risk" warning.  Even if you can clock the CPU at higher frequency,
doesn't mean you can dissipate the heat.  Sometimes the highest frequencies are
intended for bursts, not sustained operation.

Michał Nykiel

unread,
May 4, 2013, 4:17:42 AM5/4/13
to android...@googlegroups.com
I've hard coded 1GHz in frequency table and CPUFreq shows 1GHz but there's not any difference in performance.
So, there's no any way to modify AVS registers?


2013/5/4 Glenn Kasten <gka...@android.com>

Emeric VIGIER

unread,
May 4, 2013, 3:37:04 PM5/4/13
to android...@googlegroups.com
No, there is no way. AVS are Read-Only registers "burnt" during the manufacturing process.


Emeric
--
5020 St Kevin, apt 17
Montréal, QC, H3W1P4
CANADA
+1 (514) 803 5215
emeric...@gmail.com

Feche1320

unread,
Sep 19, 2013, 3:27:13 AM9/19/13
to android...@googlegroups.com
Could you explain me how you add frequencis to your kernel? I have a tegra 2 phone but I don't understand how to add new frequencies 
Reply all
Reply to author
Forward
0 new messages