Skip to content

Commit 1cf7b98

Browse files
committed
soc: rtl87x2g: pm: add debug config and change stage time
1. enlarge the exit and enter stage time 2. add config to messure actual stage time Signed-off-by: Zhiyuan Tang <zhiyuan_tang@realsil.com.cn>
1 parent 86a6b9d commit 1cf7b98

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

  • soc/arm/realtek_bee/rtl87x2g

soc/arm/realtek_bee/rtl87x2g/power.c

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
#include <zephyr/logging/log.h>
3333
LOG_MODULE_REGISTER(rtl87x2g_pm, LOG_LEVEL_INF);
3434

35+
#define REALTEK_PM_STATISTICS 0
36+
3537
struct k_work work_timeout_process;
3638
struct k_work work_device_resume;
3739

@@ -200,13 +202,32 @@ static int rtl87x2g_power_init(void)
200202

201203
z_arm_nmi_set_handler(NMI_Handler);
202204

205+
LOG_INF("Original EXIT stage time = %d, Original ENTER stage time = %d",
206+
platform_pm_system.stage_time[PLATFORM_PM_EXIT],
207+
platform_pm_system.stage_time[PLATFORM_PM_ENTER]);
208+
209+
platform_pm_system.stage_time[PLATFORM_PM_EXIT] = 30;
210+
platform_pm_system.stage_time[PLATFORM_PM_ENTER] = 50;
211+
212+
LOG_INF("Updated EXIT stage time = %d, Updated ENTER stage time = %d",
213+
platform_pm_system.stage_time[PLATFORM_PM_EXIT],
214+
platform_pm_system.stage_time[PLATFORM_PM_ENTER]);
215+
203216
platform_pm_register_callback_func_with_priority((void *)pm_suspend_devices_rtk,
204-
PLATFORM_PM_STORE, 1);
217+
PLATFORM_PM_ENTER, 1);
205218
platform_pm_register_callback_func_with_priority((void *)pm_resume_devices_rtk,
206219
PLATFORM_PM_PEND, -1);
207220
platform_pm_register_callback_func_with_priority(
208221
(void *)pm_reusme_systick_and_process_timeout, PLATFORM_PM_PEND, INT8_MAX);
209222

223+
#if REALTEK_PM_STATISTICS
224+
platform_pm_feature_cfg.platform_stage_time = 1;
225+
platform_pm_feature_cfg.platform_statistics = 1;
226+
platform_pm_feature_cfg.platform_check_dbg = 1;
227+
platform_pm_feature_cfg.platform_enter_dbg = 1;
228+
platform_pm_feature_cfg.platform_exit_dbg = 1;
229+
#endif
230+
210231
return ret;
211232
}
212233

0 commit comments

Comments
 (0)