Hi igor,
My ultimate goal is to run a program on Cortex-M4 (CM4) to control a peripheral (e.g. GPIO, UART, CAN or etc) when Cortex-A (CA) cores are in sleep (i.e. echo mem > /sys/power/state).
The current implementation puts CM4 in sleep when Linux goes into sleep. As I searched the kernel source code, there are two important files: (These are just my guesses)
1- psci.c: is used to manage CA cores, e.g. put them into sleep
2- gpc-psci.c: is used to manage imx8 power domains, e.g. to turn off power of domain and put that domain into sleep
Q1- Are the power management operations (e.g. putting CA and CM4 into sleep) implemented in Linux source code (psci.c and gpc-psci.c) or in ATF (gpc.c)? I can't realize Linux and ATF relationship in handling power management.
Q2- I guess CA core0 is always ON and not put into sleep even if I use "echo mem > /sys/power/state". Is that right?
Q3- Are there any documents about imx8mq power domains except the reference manual?