Hi,
Does anyone knows how to change the DSP clock in TI816x?Can it be done on run time?
Thanks,Gabi
Hi Gabi,
We can chagne the DSP frequency in u-boot (code), in kernel we have a provision to change the DSP clock rate runtime.
Details can get from http://processors.wiki.ti.com/index.php?title=TI81XX_PSP_PM_Clock_Framework_User_Guide
Regards
AnilKumar
Please mark this Forum post as answered via the Verify Answer button below if it helps answer your question. Thanks!
Hi Anil,
Thank you very much for your answer, i have read the wiki you have sent me carefully, i have a few questions, where exactly is the file that i need to modify in order to change the DSP frequency? since i couldn't find it at the wiki, it is explained only how to do it.Which device_id should i use for changing the DSP clock frequency?
Generally frequency modification required for a module, so we can add it in driver or driver initialization code. In case of DSP you can add to "ti8168_evm_init()" in arch/arm/mach-omap2/board-ti8168evm.c file. Refer the same document for adding the necessary clk APIs.
Thank you very much for your answer, now i know that i have to add the code
clk = clk_get(dev_id,clk_name);rate = clk_get_rate(clk);ret = clk_set_rate(clk, new_clk_rate);
in the function "ti8168_evm_init()" in the file arch/arm/mach-omap2/board-ti8168evm.cbut i still don't know what are the values for dev_id and clk_name that i need to put in order to change the DSP clock rate, can you please help with that?
Steps for change the DSP frequency.
clk = clk_get(NULL, "gem_ick");rate = clk_get_rate(clk);ret = clk_set_rate(clk, new_clk_rate);
I have changed the fuction "ti8168_evm_init()" as listed below, recompiled the kernel and checked and there is no change in DSP clock rate, please advice.
static void __init ti8168_evm_init(void){ struct clk *clk;unsigned long rate; ti81xx_mux_init(board_mux); omap_serial_init(); ti816x_evm_i2c_init(); i2c_add_driver(&ti816xevm_cpld_driver); ti81xx_register_mcasp(0, &ti8168_evm_snd_data); ti816x_spi_init(); /* initialize usb */ usb_musb_init(&musb_board_data); board_nand_init(ti816x_nand_partitions, ARRAY_SIZE(ti816x_nand_partitions), 0, NAND_BUSWIDTH_16); omap2_hsmmc_init(mmc); board_nor_init(ti816x_evm_norflash_partitions, ARRAY_SIZE(ti816x_evm_norflash_partitions), 0); ti816x_vpss_init(); ti816x_gpio_vr_init(); ti816x_hdmi_init(); regulator_has_full_constraints(); regulator_use_dummy_regulator(); // change DSP clock rateclk = clk_get(NULL, "gem_ick");rate = clk_get_rate(clk);ret = clk_set_rate(clk, 990000000);}
What is the error message you are seeing?
Lookat "dmesg"
$ dmesg | tail
Thanks for your reply, there is no error in the dmesg, i have looked on all of it.It is just that the DSP performances stay the same so i guess that there is no change in the DSP clock.
Can you please refer?
Sorry for delay in response
Can you add clk_enable(); before clk_set_rate(), so that you can able to change the rate. Wiki page will be updated with a note.
// change DSP clock rateclk = clk_get(NULL, "gem_ick");clk_enable(clk);rate = clk_get_rate(clk);ret = clk_set_rate(clk, 990000000);
Regards AnilKumar Please mark this Forum post as answered via the Verify Answer button below if it helps answer your question. Thanks!
It didn't help, DSP clock doesn't change.
Gabi
Which kernel version are you using? I tried with the latest one and its worked for me, I am able to change the rate.
If you are on the old kernel, can you change it to new one
http://software-dl.ti.com/dsps/dsps_public_sw/psp/LinuxPSP/TI81XX_04_04/04_04_00_01/index_FDS.html
I have linux-2.6.37-psp04.00.01.13.patch2, shouldn't it work on this version as well?
I had tested recently, that is the reason why I asked you to test on the same.
If you don't have any other dependencies can you try with recent kernel, mean while I will check with "psp04.00.01.13.patch2" also
Thank you very much for your effort, i am sorry but i have other dependencies, therefore it is impossible for me to update the kernel.