SoC s6: PM: ARM core wake-up issue in autosuspend [1/2]
PD#SWPL-188539
Problem:
In the autosuspend test, the ARM core occasionally fails to wake up.
Solution:
The BL30 code is primarily for power-down detection, but it can optimize
standby time.
Verify:
S6
Change-Id: Id93ccf9a3d5809d77c161e13016943de835606ca
Signed-off-by: binbin.wang <binbin.wang@amlogic.com>
diff --git a/s6/soc_business.c b/s6/soc_business.c
index be5f4be..517b5bf 100644
--- a/s6/soc_business.c
+++ b/s6/soc_business.c
@@ -83,3 +83,20 @@
create_mte_fix_task();
}
+#define PWR_STATE_WAIT_ON 16
+void check_poweroff_status(void)
+{
+ const TickType_t xTimeout = pdMS_TO_TICKS(500); //Set timeout duration to 500ms
+ TickType_t xStartTick;
+
+ xStartTick = xTaskGetTickCount();
+
+ /*Wait for cputop fsm switch to WAIT_ON*/
+ while (((REG32(PWRCTRL_CPUTOP_FSM_STS0) >> 12) & 0x1F) != PWR_STATE_WAIT_ON) {
+ if (xTaskGetTickCount() - xStartTick >= xTimeout) {
+ printf("cputop fsm check timed out!\n");
+ printf("PWRCTRL_CPUTOP_FSM_STS0: %x\n", REG32(PWRCTRL_CPUTOP_FSM_STS0));
+ vTaskSuspend(NULL);
+ }
+ }
+}