Hi,
We have an issue when enter suspend when running m7. The firmware is controlled by the rpmsg on the linux side and we have implemented a signal to set the m7 to enter GPC stop mode. According to i.MX 8M Plus Applications Processor Reference Manual, Rev. 1, 06/2021. GPC_SLPCR page.605. We set GPC_SLPCR register and another using gpc.h from MCUXpresso. We have also read the AN13400 to try to understand the limits for stop,wait and dsm with (Fast-Wake-up and non-Fast-Wake-up ).
Our goal is to enter suspend on both M and A side with PMIC_STBY_REQ set to high state. A has all wakeup functions and wake up first than wake up the M side.
We have so far got almost everting working except for PMIC_STBY_REQ set to high state. when we have gpc_stopmode with Fast-Wake-up and we understand that the PLL need to be stopped to enter DSM. Here is the m side code that running and we have tried a few diffrent combinations of gpc_lpm_config_t already but this is the one we got to wakeup the M from A:
static void suspend()
{
(void)PRINTF("Entering suspend\r\n");
gpc_lpm_config_t config;
config.enCpuClk = false;
config.enFastWakeUp = true;
config.enDsmMask = false;
config.enWfiMask = false;
config.enVirtualPGCPowerdown = true;
config.enVirtualPGCPowerup = true;
/* Lower the root clock speed to 24 Mhz, required to survive deep sleep. */
if (CLOCK_GetRootMux(kCLOCK_RootM7) != kCLOCK_M7RootmuxOsc24M)
{
CLOCK_SetRootMux(kCLOCK_RootM7, kCLOCK_M7RootmuxOsc24M);
CLOCK_SetRootDivider(kCLOCK_RootM7, 1U, 1U);
}
(void)PRINTF("Entering GPC stop mode\r\n");
/* Stop all clocks in Vcore domain but preserve RAM */
GPC_EnterStopMode(GPC, &config); /* Interrupt (e.g. rpmsg) required to pass this barrier */
/* Go into idle mode. Now it's safe to enter deep sleep. */
(void)PRINTF("Leaving GPC stop mode\r\n");
/* Any future last-moment pre-sleep actions could be taken here. */
#ifdef BOARD_DEBUG_UART_TYPE
DbgConsole_Deinit(); /* If needed, the UART port must be redeclared as 24Mhz. */
#endif
/* Do nothing so that the idle hook function is triggered before the A core goes into suspend. */
__DSB();
__ISB();
__WFI();
/* Any future resume actions could be taken here. */
/* Re-enable debug prints */
#ifdef BOARD_DEBUG_UART_TYPE
DbgConsole_Init(BOARD_DEBUG_UART_INSTANCE, BOARD_DEBUG_UART_BAUDRATE, BOARD_DEBUG_UART_TYPE,
BOARD_DEBUG_UART_CLK_FREQ);
#endif
if (CLOCK_GetRootMux(kCLOCK_RootM7) != kCLOCK_M7RootmuxSysPll1)
{
CLOCK_SetRootDivider(kCLOCK_RootM7, 1U, 1U); /* Reset root clock to 800M */
CLOCK_SetRootMux(kCLOCK_RootM7, kCLOCK_M7RootmuxSysPll1); /* Switch Cortex-M7 to SYSTEM PLL1 */
}
GPC->LPCR_M7 = GPC->LPCR_M7 & (~GPC_LPCR_M7_LPM0_MASK);
(void)PRINTF("Leaving suspend\r\n");
}
Questions
- Is it only in DSM that PMIC_STBY_REQ can be set to high state(1) from A side?
- Is it possible to wakeup the M side trough the rpmsg interrupts when it is in DSM? (we can not set any gpio wakeup pins to M side)
- Why is it not possible to wakeup when in the GPC stopmode? Instead we need to send a any rpmsg to leave the GPC stop mode function to enter __DSB, but if we skip using GPC_stopmode the M will not be able to wakeup or if we are in the GPC_stopmode it will not wake up either.
what is the minimum amount of clocks(Pll) additional to RootM7(pll1), that is needed in case we have started more clocks than we need.
Additional data
A core is running
Poky (Yocto Project Reference Distro) 4.0.13
Linux 6.1.22
M firmware
It is based on the RPMsg-Lite pingpong sample from the FreeRTOS-based MCUXpresso SDK. we are using 2 gpios as outputs no other interface is active (uart for debug on for VAR-DT8MCustomBoard when we not using our hardware Host Monitor x).
load the m7 firmware in uboot (ddr)