UDOO i.MX6 overclocked (1.2GHz)

Discussion in 'General Discussion' started by Lemele, Dec 17, 2013.

  1. Lemele

    Lemele New Member

    Joined:
    Dec 16, 2013
    Messages:
    1
    Likes Received:
    0
    Hi UDOOers,

    I'm playing with Quad core version since it was on market (october 2013). I would like to try if I can get rid of the the 1 GHz limit of the i.MX6 and reach the higher GHz frequencies.

    I've googled and looked on UDOO kernel source founding that CPU frequencies can be overclocked with very simple changes. So I decided to stretch my UDOO and risk CPU safety to gain the bogomips I need.

    As first step I understood that UDOO CPU's speed is limited to 1 GHz due to fuse OTP configuration cabled inside i.MX6 soc. It is not possible to change this fuse configuration, but we can make kernel to ignore it. So in file "arch/arm/mach-mx6/cpu_op-mx6.c" I wipe out that part of code using canonical "#if 0 ... #endif" preprocessor macro, and replaced it to fix "arm_max_freq = CPU_AT_1_2GHz":

    Code:
    void mx6_cpu_op_init(void)
    {
    unsigned int reg;
    void __iomem *base;
    if (!cpu_is_mx6sl()) {
    /*read fuse bit to know the max cpu freq : offset 0x440
    * bit[17]:SPEED_GRADING[1],for mx6dq/dl*/
    
    #if 0 /* To Overclock uDOO this part is commented out */
    base = IO_ADDRESS(OCOTP_BASE_ADDR);
    reg = __raw_readl(base + 0x440);
    reg &= (0x3 << OCOTP_SPEED_BIT_OFFSET);
    reg >>= OCOTP_SPEED_BIT_OFFSET;
    /*choose the little value to run lower max cpufreq*/
    arm_max_freq = (reg > arm_max_freq) ? arm_max_freq : reg;
    #endif
    /* To Overclock uDOO, fix CPU max frequencies to 1.2 GHz !! */
    arm_max_freq = CPU_AT_1_2GHz;
    } else {
    ....
    Saving and recompiling we will obtain an overclocked kernel that will speed up UDOO processor to 1.2 GHz with an increase of performance about 20% in pure cpu calculation.

    But this was not enough, I'm sure this board can be lift higher. To keep cool my ARM board, I ARMed myself with freezing spray and started working on "cpu op table" at the top on the same file:

    File "arch/arm/mach-mx6/cpu_op-mx6.c":

    Code:
    /* working point(wp): 0 - 1.2GHz; 1 - 792MHz, 2 - 498MHz 3 - 396MHz */
    static struct cpu_op mx6q_cpu_op_1_2G[] = {
    {
    .pll_rate = 1200000000,
    .cpu_rate = 1200000000,
    .cpu_podf = 0,
             .pu_voltage = 1275000,
             .soc_voltage = 1275000,
             .cpu_voltage = 1275000,},
    {
    ......
    Here are defined the working point used by DVFS logic to set frequency and core voltage of i.MX6.
    With a careful hack of that value we can modify max working speed of our board. To mantain cpu core stability while increasing frequency rate, a correspondent core voltage enhancement can be required.

    Moreover I found that to overstep 1.3 GHz another little change is required. On top of file "arch/arm/mach-mx6/clock.c" you need to change max video clock definition:

    File "arch/arm/mach-mx6/clock.c":

    Code:
    #define AUDIO_VIDEO_MIN_CLK_FREQ        650000000
    // #define AUDIO_VIDEO_MAX_CLK_FREQ     1300000000
    #define AUDIO_VIDEO_MAX_CLK_FREQ        1400000000
    Finally my working point structure was modified in the following way:

    File "arch/arm/mach-mx6/cpu_op-mx6.c":

    Code:
    /* working point(wp): 0 - 1.2GHz; 1 - 792MHz, 2 - 498MHz 3 - 396MHz */
    static struct cpu_op mx6q_cpu_op_1_2G[] = {
    {
    .pll_rate = 1340000000,
    .cpu_rate = 1340000000,
    .cpu_podf = 0,
    .cpu_podf = 0,
             .pu_voltage = 1300000,
             .soc_voltage = 1300000,
             .cpu_voltage = 1300000,},
    {
    ......
    I currently use this value for my uDOO and the board appears stable and performing. If I increase frequencies of just 10 MHz boards became instable, but I think on different boards maximum value can be different.

    To test performance enhancement obtained with the above procedure I used two very simple benchmarks. The first test was taken from the suite "sysbench"; it consists in the calculation of the first 10000 prime number. It is a pure CPU computing performance measure. The second was a "real life" CPU test: a simulated gzip compression through the command: "gzip -c u.tar >/dev/null". The uncompressed file was of 21 MB and the same operation was repeated 10 times to ensure a full caching of the archive and no interaction with disk throughput.

    In the following tables a summary of performance test in the three described configurations:

    Code:
    sysbench --test=cpu --cpu-max-prime=2000 run
    
    |  round  |   1 GHz    |   1.2 GHz  |  1.34 GHz  |
    |---------|------------|------------|------------|
    |    1    |  67.0514s  |  56.9674s  |  48.4431s  |
    |    2    |  67.5062s  |  56.4555s  |  48.2509s  |
    |    3    |  67.5178s  |  56.6493s  |  48.7659s  |
    |---------|------------|------------|------------|
    |   AVG   |  67.3584s  |  56.6907s  |  48.4866s  |
    |   PERC  |    100 %   |  118.82 %  |  138.92 %  |
    |---------|------------|------------|------------|

    Code:
    sysbench --test=cpu --num-threads=4 --cpu-max-prime=2000 run
    
    |  round  |   1 GHz    |   1.2 GHz  |  1.34 GHz  |
    |---------|------------|------------|------------|
    |    1    |  16.0532s  |  13.3522s  |  12.2791s  |
    |    2    |  16.0055s  |  13.3392s  |  12.0006s  |
    |    3    |  16.0187s  |  13.2930s  |  11.9677s  |
    |---------|------------|------------|------------|
    |   AVG   |  16.0258s  |  13.3281s  |  12.0824s  |
    |   PERC  |    100 %   |  120.24 %  |  132.64 %  |
    |---------|------------|------------|------------|

    Code:
    for c in `seq 10`; do gzip -c u.tar >/dev/null ; done
    
    |  round  |   1 GHz    |   1.2 GHz  |  1.34 GHz  |
    |---------|------------|------------|------------|
    |    1    |     35s    |    30s     |    27s     |
    |    2    |     35s    |    29s     |    26s     |
    |    3    |     34s    |    29s     |    26s     |
    |---------|------------|------------|------------|
    |   AVG   |   34.666s  |  29.333s   |  26.333s   |
    |   PERC  |    100 %   |  118.18 %  |  131.64 %  |
    |---------|------------|------------|------------|
    As yo can see an increment of 30% of CPU performance is possible !

    During this test there was no need for cooling the heatsink. Thanks to UDOO for providing such an efficient cooling system.

    Cheers
     
  2. Lifeboat_Jim

    Lifeboat_Jim New Member

    Joined:
    Sep 16, 2013
    Messages:
    399
    Likes Received:
    1
    Props!

    Good post too, vrry informative :)

    1.2GHz if done right makes sense, after all FreeScale ship some models of i.MX6 at that clock speed.

    1.3 could shorten the life somewhat, but if it works for you and your eyes are open then fair enough.
     
  3. Bela

    Bela Member

    Joined:
    Oct 30, 2013
    Messages:
    32
    Likes Received:
    0
    Well that's a nice thing actually. If you add a fan too the overclock would have a sense then.
     
  4. DracoLlasa

    DracoLlasa UDOOer

    Joined:
    Oct 15, 2013
    Messages:
    419
    Likes Received:
    3
    this is awesome, overclocking testing was actually on my to-do list i just never actually got to it yet, so this is great i will work on reproducing the results

    Also i really need to also thank you for introducing me to the sysbench tool. i have been looking everywhere for a tool that works on ARM and linux that can use more than 1 core so i can do some comparative benchmarking vs other types of boards. will def save this thread, thanks again for the work and for sharing the results.
     
  5. Xinran

    Xinran New Member

    Joined:
    Oct 19, 2013
    Messages:
    8
    Likes Received:
    0
    :D It's awesome! I have been waiting for this. I hope someday someone can make a config page like RPi's. It'll be much easier for linux beginners like me. :)
     
  6. tibmeister

    tibmeister New Member

    Joined:
    Oct 20, 2013
    Messages:
    19
    Likes Received:
    0
  7. dabrain

    dabrain New Member

    Joined:
    Oct 16, 2015
    Messages:
    1
    Likes Received:
    0
    tibmeister, is there a place i could have information about the different imx6q cuts or version which could support the 1.2GHz. I tried with my current imx6q to overclock to 1.2GHZ but i faced some various and random kernel crash.
     

Share This Page