Hi,
This is code from one of my peers that enable the CM4
void m4_run_bin(unsigned char *bin, size_t size)
{
/* M4 access for all peripherals on the bus */
writel(0x77777777, AIPS1_ON_BASE_ADDR );
writel(0x77777777, AIPS2_ON_BASE_ADDR );
writel(0x77777777, AIPS3_ON_BASE_ADDR );
/* M4 Clock On */
writel(readl(CCM_CCGR3) | (0x3<<2), CCM_CCGR3);
memcpy(TCM, bin, size);
/* Enable M4 and Assert the soft reset */
writel(readl(SRC_SCR) | (1<<22) | (1<<4), SRC_SCR);
/* Release the reset for M4 */
writel(readl(SRC_SCR) & ~(1<<4), SRC_SCR);
}
You have to make sure in the CA9 that the clock of the M4 is enabled too.
The 0x007f8000 is a fixed memory where the vector table is looked for by the the CM4 when booting.
Best Regards,
Alejandro