Change DRAM freq

Hi all,
Can you help me in some unstandard procedure ?
I need to change DRAM freq by some research reasons.
I’ve already made this but on another dev-board.

I coula able by changing multiplicator in the u-boot function kind of
ddr_set_t __ddr_setting[] __attribute__ ((section(".ddr_param"))) =

This DRAM multiplicator describes like:

DRAMFreq: 
 *            {pstate0, pstate1, pstate2, pstate3} //more than one pstate means use dynamic freq

The question is - Can I able to do the same on ROCK 5b dev-board ?
Can somebody help me in that ?

rock5b uses blob TPL from rockchip,

you can technically edit the clock frequency using ddr_bin tool, but i have never tried this myself.

2 Likes

Thanks a lot.
I haven’t heard about this way before.
I’ve used for another dev a such way

Edit file board/khadas/kvim4/firmware/timing.c to find DRAMFreq to change the frequency.

 * DRAMFreq:
 *            {pstate0, pstate1, pstate2, pstate3} //more than one pstate means use dynamic freq
...
                .DramType = CONFIG_DDR_TYPE_LPDDR4,
                .enable_lpddr4x_mode = ENABLE_LPDDR4X_MODE,
                .DRAMFreq ={ 2016,                     0,       0,       0       },
...

Will try. Thanks one more time. For the first glance it looks suitable.

Just to return knowledge to collective intelligence.

Ohhhh. It looks that everything have become much easier then I’ve thought
Just read this.

/sys/class/devfreq/dmc/userspace/set_freq 

It provide an ability to set your own freq.
I’ve checked it by stream. Yep. It really works.

1 Like

Some benchmark numbers generated with different DMC settings: https://github.com/ThomasKaiser/sbc-bench/issues/55#issuecomment-1309375720

Please note that the DMC ability usually is only there as long as you rely on Rockchip’s outdated BSP kernel (and that’s true for all RK SoCs since a decade). Once you switch to mainline kernel the DMC stuff may be gone.

1 Like

Great point. Thank you.