Part Number: AM263P4
Tool/software:
Hi,
In the following SDK code from `am263px/source/drivers/soc/am263px/soc.c` it appears that the SDK is not unlocking/locking the registers before enabling/disabling the the peripheral clocks. I think its necessary b/c the MSS_RCM block is controlled with a lock register. Can you verify?
Also, can you provide a recommendation on a synchronization mechanism so that multiple cores unlocking/locking don't result in locking out writes? E.g. core 0 unlocks, core 1 unlocks, core 0 writes a reg A, core 0 locks, core 1 tries to write reg B (write fails)
-Colin
int32_t SOC_moduleClockEnable(uint32_t moduleId, uint32_t enable)
{
int32_t status = SystemP_SUCCESS;
status = SOC_rcmEnablePeripheralClock((SOC_RcmPeripheralId)moduleId, enable);
return status;
}
int32_t SOC_moduleSetClockFrequency(uint32_t moduleId, uint32_t clkId, uint64_t clkRate)
{
int32_t status = SystemP_SUCCESS;
SOC_controlModuleUnlockMMR(0, MSS_RCM_PARTITION0);
status = SOC_rcmSetPeripheralClock((SOC_RcmPeripheralId)moduleId, (SOC_RcmPeripheralClockSource)clkId, (uint32_t)clkRate);
SOC_controlModuleLockMMR(0, MSS_RCM_PARTITION0);
return status;
}