From 74756891cc3524084add9879d451cd67bf446bd7 Mon Sep 17 00:00:00 2001 From: Anup Patel Date: Sat, 6 Feb 2021 14:48:56 +0530 Subject: lib: sbi: Implement SBI HSM suspend function This patch implements the SBI HSM suspend function. Using this new SBI call, the S-mode software can put calling HART in platform specific suspend (i.e. low-power) state. For a successful retentive suspend, the SBI call will return without errors upon resuming whereas for a successful non-retentive suspend, the SBI call will resume from a user provided resume address. Signed-off-by: Anup Patel Reviewed-by: Atish Patra --- include/sbi/sbi_hsm.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/sbi') diff --git a/include/sbi/sbi_hsm.h b/include/sbi/sbi_hsm.h index 4250515..bf0c1a5 100644 --- a/include/sbi/sbi_hsm.h +++ b/include/sbi/sbi_hsm.h @@ -22,6 +22,10 @@ int sbi_hsm_hart_start(struct sbi_scratch *scratch, const struct sbi_domain *dom, u32 hartid, ulong saddr, ulong smode, ulong priv); int sbi_hsm_hart_stop(struct sbi_scratch *scratch, bool exitnow); +void sbi_hsm_hart_resume_start(struct sbi_scratch *scratch); +void sbi_hsm_hart_resume_finish(struct sbi_scratch *scratch); +int sbi_hsm_hart_suspend(struct sbi_scratch *scratch, u32 suspend_type, + ulong raddr, ulong rmode, ulong priv); int sbi_hsm_hart_get_state(const struct sbi_domain *dom, u32 hartid); int sbi_hsm_hart_interruptible_mask(const struct sbi_domain *dom, ulong hbase, ulong *out_hmask); -- cgit v1.2.3