From: Anup Patel <apatel@ventanamicro.com>
To: opensbi@lists.infradead.org
Subject: [PATCH 09/16] lib: sbi: Add optional resume address to hart suspend
Date: Tue, 6 Aug 2024 13:03:31 +0530 [thread overview]
Message-ID: <20240806073338.1856901-10-apatel@ventanamicro.com> (raw)
In-Reply-To: <20240806073338.1856901-1-apatel@ventanamicro.com>
From: Subrahmanya Lingappa <slingappa@ventanamicro.com>
Add an optional resume address to the platform specific hart suspend call.
Signed-off-by: Subrahmanya Lingappa <slingappa@ventanamicro.com>
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
---
include/sbi/sbi_hsm.h | 6 +++++-
lib/sbi/sbi_hsm.c | 6 +++---
platform/generic/allwinner/sun20i-d1.c | 2 +-
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/include/sbi/sbi_hsm.h b/include/sbi/sbi_hsm.h
index 4b5601ba..aa692dfe 100644
--- a/include/sbi/sbi_hsm.h
+++ b/include/sbi/sbi_hsm.h
@@ -39,8 +39,12 @@ struct sbi_hsm_device {
*
* For successful non-retentive suspend, the hart will resume from
* the warm boot entry point.
+ *
+ * NOTE: mmode_resume_addr(resume address) is optional hence it
+ * may or may not be honored by the platform. If its not honored
+ * then platform must ensure to resume from the warmboot address.
*/
- int (*hart_suspend)(u32 suspend_type);
+ int (*hart_suspend)(u32 suspend_type, ulong mmode_resume_addr);
/**
* Perform platform-specific actions to resume from a suspended state.
diff --git a/lib/sbi/sbi_hsm.c b/lib/sbi/sbi_hsm.c
index 3706acfb..2f518d44 100644
--- a/lib/sbi/sbi_hsm.c
+++ b/lib/sbi/sbi_hsm.c
@@ -228,10 +228,10 @@ static int hsm_device_hart_stop(void)
return SBI_ENOTSUPP;
}
-static int hsm_device_hart_suspend(u32 suspend_type)
+static int hsm_device_hart_suspend(u32 suspend_type, ulong mmode_resume_addr)
{
if (hsm_dev && hsm_dev->hart_suspend)
- return hsm_dev->hart_suspend(suspend_type);
+ return hsm_dev->hart_suspend(suspend_type, mmode_resume_addr);
return SBI_ENOTSUPP;
}
@@ -536,7 +536,7 @@ int sbi_hsm_hart_suspend(struct sbi_scratch *scratch, u32 suspend_type,
__sbi_hsm_suspend_non_ret_save(scratch);
/* Try platform specific suspend */
- ret = hsm_device_hart_suspend(suspend_type);
+ ret = hsm_device_hart_suspend(suspend_type, scratch->warmboot_addr);
if (ret == SBI_ENOTSUPP) {
/* Try generic implementation of default suspend types */
if (suspend_type == SBI_HSM_SUSPEND_RET_DEFAULT ||
diff --git a/platform/generic/allwinner/sun20i-d1.c b/platform/generic/allwinner/sun20i-d1.c
index ab2eee55..33312e0b 100644
--- a/platform/generic/allwinner/sun20i-d1.c
+++ b/platform/generic/allwinner/sun20i-d1.c
@@ -152,7 +152,7 @@ static void sun20i_d1_riscv_cfg_init(void)
writel_relaxed(entry >> 32, SUN20I_D1_RISCV_CFG_BASE + RESET_ENTRY_HI_REG);
}
-static int sun20i_d1_hart_suspend(u32 suspend_type)
+static int sun20i_d1_hart_suspend(u32 suspend_type, ulong mmode_resume_addr)
{
/* Use the generic code for retentive suspend. */
if (!(suspend_type & SBI_HSM_SUSP_NON_RET_BIT))
--
2.34.1
next prev parent reply other threads:[~2024-08-06 7:33 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-06 7:33 [PATCH 00/16] RPMI and SBI MPXY support for OpenSBI Anup Patel
2024-08-06 7:33 ` [PATCH 01/16] lib: Increase ROOT_REGION_MAX to accomodate more memregions Anup Patel
2024-08-06 7:33 ` [PATCH 02/16] lib: utils/mailbox: Add generic mailbox library Anup Patel
2024-08-06 7:33 ` [PATCH 03/16] lib: utils/mailbox: Add simple FDT based mailbox framework Anup Patel
2024-08-06 7:33 ` [PATCH 04/16] lib/utils: Add RPMI messaging protocol and shared memory transport support Anup Patel
2024-08-16 1:01 ` Bo Gan
2024-08-17 6:54 ` Anup Patel
2024-08-26 22:34 ` Bo Gan
2024-08-06 7:33 ` [PATCH 05/16] lib/utils: reset: Add RPMI System Reset driver Anup Patel
2024-08-06 7:33 ` [PATCH 06/16] lib: utils: Add simple FDT based system suspend driver framework Anup Patel
2024-08-06 7:33 ` [PATCH 07/16] lib: utils/suspend: Add RPMI system suspend driver Anup Patel
2024-08-06 7:33 ` [PATCH 08/16] lib: utils: Add simple FDT based HSM driver framework Anup Patel
2024-08-06 7:33 ` Anup Patel [this message]
2024-08-06 7:33 ` [PATCH 10/16] lib: utils/hsm: Add RPMI HSM driver Anup Patel
2024-08-06 7:33 ` [PATCH 11/16] lib: utils: Add simple FDT based CPPC driver framework Anup Patel
2024-08-06 7:33 ` [PATCH 12/16] lib: utils/cppc: Add RPMI CPPC driver Anup Patel
2024-08-06 7:33 ` [PATCH 13/16] lib: sbi: Add SBI Message Proxy (MPXY) framework Anup Patel
2024-10-11 11:26 ` Yu-Chien Peter Lin
2024-10-11 11:51 ` Rahul Pathak
2024-08-06 7:33 ` [PATCH 14/16] lib: sbi: Implement SBI MPXY extension Anup Patel
2024-08-07 9:24 ` Yu-Chien Peter Lin
2024-08-07 9:34 ` Rahul Pathak
2024-08-07 9:46 ` Yu-Chien Peter Lin
2024-08-06 7:33 ` [PATCH 15/16] lib: utils: Add simple FDT based MPXY driver framework Anup Patel
2024-08-06 7:33 ` [PATCH 16/16] lib: utils/mpxy: Add RPMI client driver for MPXY Anup Patel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240806073338.1856901-10-apatel@ventanamicro.com \
--to=apatel@ventanamicro.com \
--cc=opensbi@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.