I'm trying to change the CPU clock on a MVEBU based WD MyCloud Mirror Gen2.
I've studied the u-boot sources from WD (https://support-en.wd.com/app/products/product-detailweb/p/137 WDMyCloud_Mirror_GPL_v2.31.204_20191206.tar.gz), a customized version of uboot 2013.01-14t3 (github mirror https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/tree/u-boot-2013.01-14t3)
On my device I've a modified uboot re-enabling save env (https://forum.doozan.com/read.php?2,35291) and now I'm trying to understand how-to change the cpu speed.
If I'm not wrong, that configuration could be saved in SatR, and could be loaded from TWSI (i2C device?). In the uboot terminal I've tried only the SatR list and SatR read command, unsuccessfully.
Looking at mvCtrlEnvLib.c, mvCtrlEnvRegs.h, mvCpu.c, cmd_sar38x.c and mvOs.h, I've undestood that the CPU configuration is read through the call (mvCpu.c)mvCpuPclkGet -> (mvCtrlEnvLib.c)mvCtrlCpuDdrL2FreqGet -> (mvOs.h)MV_REG_READ -> (mvOs.h)MV_MEMIO_LE32_READ(INTER_REGS_BASE | (offset)) -> (mvOs.h)MV_MEMIO32_READ -> ((*((volatile unsigned int*)(addr))))
The frequencies are defined in mvCtrlEnvRegs.h->MV_SAR_FREQ_MODES
Any help to go any further? Where is really stored the value, and how can ba changed? The TWSI must be reenabled?
*** edit ***
at https://forum.doozan.com/read.php?2,35291,136911#msg-136911 I've posted a first unsuccessful attemp. Still searching for help.
I've studied the u-boot sources from WD (https://support-en.wd.com/app/products/product-detailweb/p/137 WDMyCloud_Mirror_GPL_v2.31.204_20191206.tar.gz), a customized version of uboot 2013.01-14t3 (github mirror https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/tree/u-boot-2013.01-14t3)
On my device I've a modified uboot re-enabling save env (https://forum.doozan.com/read.php?2,35291) and now I'm trying to understand how-to change the cpu speed.
If I'm not wrong, that configuration could be saved in SatR, and could be loaded from TWSI (i2C device?). In the uboot terminal I've tried only the SatR list and SatR read command, unsuccessfully.
Looking at mvCtrlEnvLib.c, mvCtrlEnvRegs.h, mvCpu.c, cmd_sar38x.c and mvOs.h, I've undestood that the CPU configuration is read through the call (mvCpu.c)mvCpuPclkGet -> (mvCtrlEnvLib.c)mvCtrlCpuDdrL2FreqGet -> (mvOs.h)MV_REG_READ -> (mvOs.h)MV_MEMIO_LE32_READ(INTER_REGS_BASE | (offset)) -> (mvOs.h)MV_MEMIO32_READ -> ((*((volatile unsigned int*)(addr))))
The frequencies are defined in mvCtrlEnvRegs.h->MV_SAR_FREQ_MODES
Any help to go any further? Where is really stored the value, and how can ba changed? The TWSI must be reenabled?
*** edit ***
at https://forum.doozan.com/read.php?2,35291,136911#msg-136911 I've posted a first unsuccessful attemp. Still searching for help.