RK3566: add suspend mode configuration driver#2361
RK3566: add suspend mode configuration driver#2361Zetarancio wants to merge 2 commits intoROCKNIX:nextfrom
Conversation
| +#include <linux/of.h> | ||
| +#include <linux/platform_device.h> | ||
| + | ||
| +#define SIP_SUSPEND_MODE 0x82000003 |
There was a problem hiding this comment.
This isn't defined a defined mode in mainline. This SIP SMC function ID is BSP-specific and not registered in the upstream ARM SMCCC/SIP space.
There was a problem hiding this comment.
You’re right that 0x82000003 is not a defined or registered SMC in mainline ARM SMCCC/SIP. It is a Rockchip BSP SiP (Silicon Provider) SMC.
It works because Rockchip’s BL31 (the ATF binary from rkbin that U-Boot loads as BL31) implements this function ID. When the kernel issues this SMC, the trap goes to EL3 and that vendor BL31 handles 0x82000003 and configures the deep-sleep/wakeup flags. So the “contract” is between this driver and the Rockchip BSP firmware, not with upstream SMCCC.
For logs see here.
- Add driver that configures BL31 deep-sleep flags via SIP SMC (SIP_SUSPEND_MODE 0x82000003) using DT properties from the rk3568-suspend node; matches BSP suspend configuration protocol. - Comments generalized to refer to BSP interface without naming specific repos or devices.
|
Am working through freq scaling issues atm ; once that's stable and in a PR'able/workable state I'll have at look at this |
|
heya - am having a look at this tonight - Now I validated out the DMC patches separately with power measurements; should give us an idea of how much this actually save and if it's stable |
Suspend driver (all RK3566 devices)
Configures BL31 deep-sleep flags via SMC so vdd_logic-off and deepest sleep work. Requires BL31 in U-Boot (already present upstream for RK3566).
Files:
CONFIG_RK3568_SUSPEND_MODE=yDTS (per device): Each board needs one node:
compatible = "rk3568,pm-config",rockchip,sleep-mode-config,rockchip,wakeup-config(and optionallyrockchip,sleep-debug-en). The driver looks up by node name"rk3568-suspend".So a minimal "suspend config for RK3566" change is: kernel config + patch + this small DTS node (can be in a shared dtsi or each board).
See https://github.com/Zetarancio/distribution/blob/flip/projects/ROCKNIX/devices/RK3566/linux/dts/rockchip/rk3566-miyoo-flip.dts for an example.