RK3506 休眠
说明
搞下休眠相关的。
也可以查看SDK里面的文档:Rockchip_Developer_Guide_Power_Analysis_CN.pdf
路径是:docs\cn\Common\POWER\
步骤
功耗可以少一半 之前电流是0.075A 休眠之后是0.032A、
# 休眠
echo mem > /sys/power/state
日志:
root@rk3506-buildroot:/# echo mem > /sys/power/state
[ 567.335678] PM: suspend entry (deep)
[ 567.355864] Filesystems sync: 0.020 seconds
[ 567.356577] Freezing user space processes
[ 567.364742] Freezing user space processes completed (elapsed 0.008 seconds)
[ 567.364794] OOM killer disabled.
[ 567.364812] Freezing remaining freezable tasks
[ 567.366051] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
[ 567.366093] printk: Suspending console(s) (use no_console_suspend to debug)
3.13.0-958-g46dcf51e88a #chenjh (gcc version 10.2.1 20201103 (GNU Toolchain for the A-profile Architecture 10.2-2020.11 (arm-10.16))) #2 Thu Mar 6 10:17:27 CST 2025 arm, fwver: v2.10
gcfg: cnt=2 global=0x000002b4, pwren=0x0000c2c0, wakeup=0x20000008, dbg=0x00000000, idle: 0, 0, 0
rc400: hz=346500, div=4513/47722
gpll:on, v0pll:on, v1pll:down
suspend-mode: armoff_ddrpd, 24m_osc_dis, 32k_clk, 32k_src_rc, pwm0_ch0_regulator
pwren-core: gpio0_a2 (act:low)
pwren-sleep: gpio0_a0 (act:low)
wakeup-en: gpio0_int, pmu_timeout_int
sleep-io:
ff950208 0c000000
ff950408 00200000
ff950200 00330000
ff950200 00c00080
ff950204 00030002
0123g4567#58|wfi
配置了十秒自动唤醒
yangx@u20:~/linux2/yangx/RK3506/kernel$ git diff
diff --git a/arch/arm/boot/dts/rk3506b- -emmc.dts b/arch/arm/boot/dts/rk3506b- -emmc.dts
index 8a7664cbd50c..dd5668e217f6 100644
--- a/arch/arm/boot/dts/rk3506b- -emmc.dts
+++ b/arch/arm/boot/dts/rk3506b- -emmc.dts
@@ -5,6 +5,7 @@
/dts-v1/;
+#include <dt-bindings/suspend/rockchip-rk3506.h>
#include "rk3506.dtsi"
#include "rk3506-evb1-v10.dtsi"
@@ -83,6 +84,23 @@ hub_4g_gpio {
status = "okay";
};
+ /*
+ * 开发阶段自测:进入待机后由 PMU timer 在 N 秒后自动唤醒,用来验证
+ * “待机 -> 唤醒” 整条链路,无需外部唤醒源。
+ * 注意:本节点存在时每 N 秒会醒一次,验证完请删除本节点。
+ * 参考 Rockchip_RK3506_Developer_Guide_System_Suspend_CN 2.5 节。
+ */
+ rockchip-suspend-debug {
+ compatible = "rockchip,pm-config";
+ status = "okay";
+
+ rockchip,sleep-debug-en = <
+ (0
+ | RKPM_DBG_TIMEOUT_S(10)
+ )
+ >;
+ };
+
wireless-bluetooth {
status = "disabled";
};
@@ -223,3 +241,18 @@ flash@0 {
status = "disabled";
};
};
+
+/*
+ * 唤醒源:RKPM_GPIO0_WAKEUP_EN 沿用 rk3502.dtsi 默认值(GPIO0 保持在唤醒
+ * 使能列表里,后续接按键/RTC 中断可直接使用);
+ * 本次新增 RKPM_PMU_TIMEOUT_EN,配合上面的 rockchip-suspend-debug 实现定时唤醒。
+ * 验证完成后:同时删除上面 rockchip-suspend-debug 节点以及 RKPM_PMU_TIMEOUT_EN。
+ */
+&rockchip_suspend {
+ rockchip,wakeup-config = <
+ (0
+ | RKPM_GPIO0_WAKEUP_EN
+ | RKPM_PMU_TIMEOUT_EN
+ )
+ >;
+};
唤醒日志:
wakeup-pmu: pmu_timeout_int
Wfi-total: 9.822s (this: 4.911s)
I/TC: Secondary CPU 1 initializing
I/TC: Secondary CPU 1 switching to normal world boot
I/TC: Secondary CPU 2 initializing
I/TC: Secondary CPU 2 switching to normal world boot
本文来自博客园,作者:杨旭0324,转载请注明原文链接:https://www.cnblogs.com/allalonewithyou/p/23098210,个人邮箱:yaonie4444@foxmail.com

浙公网安备 33010602011771号