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.

Linux: How to change DSP clock when using Linux OS on ARM as Master.

Other Parts Discussed in Thread: OMAPL138, OMAP-L138, DA8XX

Tool/software: Linux

Hi there, I am currently working on the OMAPL138 SoC. and managed to get the DSP booting from Linux but would like to change the DSP core frequescy from 300Mhz to 456Mhz. Could you please, advise. Thanks. 

  • Hi,

    You can use devmem2 to set the PLL0 & the corresponding PLL0_SYSCLK1, which sources the ARM & DSP clocks.

    To see which registers are needed, you can refer to the OMAP-L138 gel file (see attached 1537.OMAP-L138_LCDK.gel)

    Best Regards,
    Yordan

  • Hi Yordan, thanks for your reply. Could you give us an example of how to use devmem2 from Linux to set the PLL settings. Thanks.
  • Let's say you want to read/write the PLLC0 Control Register (PLLCTL) at address 0x01C11100, then from linux user space you execute the following commands:
    root@omapl138-lcdk:~# devmem2 0x01C11100 ===> read
    /dev/mem opened.
    Memory mapped at address 0xb6f11000.
    Read at address 0x01C11100 (0xb6f11100): 0x00000049
    root@omapl138-lcdk:~# devmem2 0x01C11100 w 0x41 ===> write 0x41
    /dev/mem opened.
    Memory mapped at address 0xb6f92000.
    Read at address 0x01C11100 (0xb6f92100): 0x00000049
    Write at address 0x01C11100 (0xb6f92100): 0x00000041, readback 0x00000041
    root@omapl138-lcdk:~# devmem2 0x01C11100 ===> read again to verify the register write was correct.
    /dev/mem opened.
    Memory mapped at address 0xb6fdc000.
    Read at address 0x01C11100 (0xb6fdc100): 0x00000041
    root@omapl138-lcdk:~#


    Best Regards,
    Yordan

  • Hi Yordan,
    so it's okay to change the PLL clock while ARM core is running Linux?
    So I guess, I can use the steps from GEL file to get this done, of course with the method you mentioned above for reading and writing.
  • Correct. Just something that I should mention. Using devmem2, the settings will be lost on every bootup.
    If you want to have permanent solution, you should modify the kernel sources to set the dsp clock to 456 MHz.

    Have a look at the remoteproc driver: da8xx_remoteproc.c

    Best Regards,
    Yordan
  • Hi Yordan,
    Yes, was thinking about it. I would like it to be permanent solution.
    I will go through the driver you mentioned. However, is there any function where I can change all PLL0 settings. Like not only dsp clock but DDR, SPI, UART, etc

    Thanks.
  • Hi,

    It is more complicated, than changing just one function.

    For the peripherals you need to check:
    arch/arm/boot/dts/da850.dtsi & arch/arm/boot/dts/da850-lcdk.dts
    Search for clock frequency parameters in the device tree nodes.

    For DDR & low level pll settings you should have a look at u-boot source:
    arch/arm/mach-davinci/da850_lowlevel.c

    In the kernel you should have a look at the sources under arch/arm/mach-davinci/

    Best Regards,
    Yordan
  • Thanks Yordan, will try to look at this. Cheers.