This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

OMAPL138 clock speed

Other Parts Discussed in Thread: OMAPL138

Hi,

I would like to increase the CPU speed to maximum. Which is the easiest place to do it: uBoot, Linux, SYS/BIOS application's Platform.xdc or some other?

risto

  • How are you configuring the PLLs and DDR initially? This can be done using UBL or with AIS commands. Personally I like the AIS method as it eliminates an entire stage of booting. That's where I would do it.
  • Hi Risto,
    What board are you using ?
    OMAPL138 supports 456Mhz clock speed (max).
    By default, LCDK board got enabled to 456Mhz.

    As Brad recommended, you can try to increase through AIS commands while converting u-boot image to AIS formatted but make sure that u-boot code won't over ride the PLL again.
  • Brad, Titus,

    Thank you. I use combined AIS/uBoot to boot board from external SPI-FLASH. AIS would naturally be the best place to tune speed. I need to study uBoot, already customized from mcsdk_1_01_00_02 -package, to check if it will touch clock as Titus pointed. I've custom board designed to run maximum speed.

    Risto
  • Hi,
    Which SDK version are you using ?
    Are you using UBL like legacy model ?
    Which u-boot configuration are you using ?
    i.e reference board config
    include/configs/
  • Hi Titus,

    I'm using mcsdk_1_01_00_02, which includes linux-3.3-psp03.22.00.06.sdk and u-boot-2012.04.01-psp03.22.00.06.sdk
    No, I have uBoot image I input to AisGen
    omapl138_lcdk.h
  • Hi Risto,
    Then I hope u-boot won't do any PLL initialization i.e no more over riding.

    If you want PLL and DDR initialization in u-boot then you may need the following definitions.

    #define CONFIG_SYS_DA850_DDR_INIT
    #define CONFIG_SYS_DA850_PLL_INIT
    u-boot/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
  • Thank you Titus,

    Those definitions you mentioned were found in da850evm.h. I recompiled uBoot and kernel and got some errors while booting kernel:

    Division by zero in kernel.

    Backtrace:

    [<c000c1a8>] (dump_backtrace+0x0/0x110) from [<c02d5f80>] (dump_stack+0x18/0x1c)

     r6:fffffffb r5:00000000 r4:c797bdb8 r3:c03e80c0

    [<c02d5f68>] (dump_stack+0x0/0x1c) from [<c000c2d0>] (__div0+0x18/0x20)

    etc. etc.

    Quite similar to ones reported in :

    http://stackoverflow.com/questions/27783606/controlling-ti-omap-l138-frequency-leads-to-division-by-zero-in-kernel 

    http://processors.wiki.ti.com/index.php/What_is_my_DSP_clock_speed "

    And it stayed 300MHz whatever tricks I tried. "echo" mentioned in stackoverflow did not have effect - should it have??.

    I used PLL settings (xtal=24MHz)   pre-div=1, multiplier=19, post-div=1 (AisGen values)

    risto

  • Hi Risto,
    Those definitions you mentioned were found in da850evm.h. I recompiled uBoot and kernel and got some errors while booting kernel:

    You said that you are using OMAPL138 LCDK board and u-boot config file should be " omapl138_lcdk.h" right, so why you are building u-boot with "da850evm.h" ?

    After you modified the u-boot for 456Mhz frequency then you would get the "ARM Clock : 456000000" print from u-boot.

    Use the following lines for 456Mhz ARM clock and update me.

    #define CONFIG_SYS_DA850_PLL_INIT
    #define CONFIG_SYS_DA850_DDR_INIT

    #define CONFIG_SYS_DV_CLKMODE 0
    #define CONFIG_SYS_DA850_PLL0_POSTDIV 0
    #define CONFIG_SYS_DA850_PLL0_PLLDIV1 0x8000
    #define CONFIG_SYS_DA850_PLL0_PLLDIV2 0x8001
    #define CONFIG_SYS_DA850_PLL0_PLLDIV3 0x8002 /* 150MHz */
    #define CONFIG_SYS_DA850_PLL0_PLLDIV4 0x8003
    #define CONFIG_SYS_DA850_PLL0_PLLDIV5 0x8002
    #define CONFIG_SYS_DA850_PLL0_PLLDIV6 CONFIG_SYS_DA850_PLL0_PLLDIV1
    #define CONFIG_SYS_DA850_PLL0_PLLDIV7 0x8005

    #define CONFIG_SYS_DA850_PLL1_POSTDIV 1
    #define CONFIG_SYS_DA850_PLL1_PLLDIV1 0x8000
    #define CONFIG_SYS_DA850_PLL1_PLLDIV2 0x8001
    #define CONFIG_SYS_DA850_PLL1_PLLDIV3 0x8002

    #define CONFIG_SYS_DA850_PLL0_PLLM 18 /* PLL0 -> 456 MHz */
    #define CONFIG_SYS_DA850_PLL1_PLLM 24 /* PLL1 -> 300 MHz */
  • Hi Titus,

    Sorry my mistake, naturally omapl138_lcdk.h, not da850evm.h.

    Anyhow I made additions you proposed to omapl138_lcdk.h and verified from autoconf.mk that they really excisted there - unfortunately I could not see any affect, no speed change not any "ARM Clock : xxx" print??!! After boot to linux the maximum frequency still was 300MHz. Most likely something is still missing in my u-boot settings.

    I went step backwards to "Division by zero in kernel" I described earlier and thought that maybe kernel does not "understand" this new speed AisGen is setting (u-boot seems not touch at the moment speed settings). I violently removed the switch clause from board-da850-evm.c, which I'm using as a backbone of my kernel, and replaced it with few lines you can see below: "Division by zero in kernel blaablaa" disappeared from boot and DSPClockSpeed gave 456MHz.

    Risto


    // --------------------------------------------------------------------------------
    // CPY FREQ setting function

    #ifdef CONFIG_CPU_FREQ
    static __init int da850_evm_init_cpufreq(void)
    {
    pr_info("----------------------------CPU MAX SPEED ----------------- \n");

    da850_max_speed = 456000;
    pr_info("CPU MAX SPEED 456MHz \n");
    return da850_register_cpufreq("pll0_sysclk3");
    }
  • Why are we adjusting the CPU frequency in u-boot? This should be done through AISgen, at least in my opinion.
  • Hi Brad,

    And thank you for your comment. The time we discussed about u-boot with Titus it was not clear if u-boot will touch CPU clock or not, now it is clear that it does not. The problem was that Linux kernel was samehow "verifying" clock and if it was set to 456MHz, it vas downscaled to 300MHz by kernel - I managed to remove that part of the kernel.

    Risto
  • Hi Risto,
    Now, you able to configure the board to 456MHz right.
    Thanks for your update.
  • Risto,

    Glad to hear your problem is solved. Nice find! If you have a patch you can share that would be a nice contribution to the community.

    Brad

  • Thanks Brad,

    Changes I did can be seen in my reply to Titus with explanation, I'm not so good in patches ;-)

    Risto