summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBen Zong-You Xie <[email protected]>2026-07-28 16:10:40 +0800
committerAnup Patel <[email protected]>2026-09-01 10:46:23 +0530
commit0fb479930775cf86efdfd5c50ad21b4cf8353c76 (patch)
treeef74e3e5b5b8b6b24aa23fe7aa156d21731512f4 /include
parente01bd7926b5d808d883df18c6ac919dfa9ab04e7 (diff)
lib: utils/suspend: wait for the secondary Andes harts to sleep
A secondary hart may not have reached the target sleep state by the time the primary checks, so the one-shot check could fail spuriously. Poll each PCS status instead and give up after HART_SLEEP_TIMEOUT_MS. Rework atcsmu_pcs_is_sleep() into the atcsmu_hart_is_sleep() predicate so sbi_timer_waitms_until() can drive it. Signed-off-by: Ben Zong-You Xie <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/sbi_utils/hsm/fdt_hsm_andes_atcsmu.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/sbi_utils/hsm/fdt_hsm_andes_atcsmu.h b/include/sbi_utils/hsm/fdt_hsm_andes_atcsmu.h
index 20e6cea0..bb9a2bc2 100644
--- a/include/sbi_utils/hsm/fdt_hsm_andes_atcsmu.h
+++ b/include/sbi_utils/hsm/fdt_hsm_andes_atcsmu.h
@@ -9,6 +9,11 @@
#include <sbi/sbi_types.h>
+struct atcsmu_sleep_arg {
+ u32 hartid;
+ bool deep_sleep;
+};
+
/* clang-format off */
#define SCRATCH_PAD_OFFSET 0x40
@@ -61,6 +66,6 @@ int atcsmu_set_reset_vector(u64 wakeup_addr, u32 hartid);
u32 atcsmu_get_sleep_type(u32 hartid);
void atcsmu_write_scratch(u32 value);
u32 atcsmu_read_scratch(void);
-bool atcsmu_pcs_is_sleep(u32 hartid, bool deep_sleep);
+bool atcsmu_hart_is_sleep(void *opaque);
#endif