System suspend (A83T)
I have been working on addin support for system suspend to A83T. The code for that is integrated into my linux/tbs tree, and into my crust firmare tree.
System suspend is done on multiple levels:
- Userspace processes are stopped/frozen.
- Linux suspends individual devices it has drivers loaded for (if the driver has suspend/resume callbacks implemented)
- Linux offlines all but one CPU core itself via code inside arm/mach-sunxi
- Linux sends a SCPI message to crust firmware to suspend the last core
- crust shuts down:
- the last CPU core and the entire CPU core cluster and power gates it
- turns off CPU clocks and CPU voltage regulators
- sets DRAM to self-refresh, powers down memory controller
- sets GPIO ports that will have to remain powered to hold mode (to hold their current state)
- configures PMIC for sleep mode
- disables remaining non-critical clocks, PLLs, etc.
Management firmware (crust) then loops and watches for wakeup interrupts and restores the system into running state if necessary.
At the moment, the status is that Linux side is fairly complete. Crust receives the suspend message but ignores it, and Linux puts the last core into WFI.
If the interrupts happens, it is handled by the Linux kernel when the last ARM core exits WFI.
More work needs to be done, to save power during suspend. With the above method, the system consumes about 900mW in suspended state.