From: Yu-Chien Peter Lin <peter.lin@sifive.com>
To: opensbi@lists.infradead.org
Cc: zong.li@sifive.com, greentime.hu@sifive.com,
Yu-Chien Peter Lin <peter.lin@sifive.com>
Subject: [RFC PATCH 2/3] lib: sbi_init: Call hart init before platform early init
Date: Tue, 24 Feb 2026 11:17:32 +0800 [thread overview]
Message-ID: <20260224031733.3817148-2-peter.lin@sifive.com> (raw)
In-Reply-To: <20260224031733.3817148-1-peter.lin@sifive.com>
To allow the platform early_init hook to use the
sbi_hart_has_extension() helper, reorder the
initialization sequence to call sbi_hart_init()
prior to sbi_platform_early_init() during both
cold and warm boot paths.
Reviewed-by: Greentime Hu <greentime.hu@sifive.com>
Reviewed-by: Zong Li <zong.li@sifive.com>
Signed-off-by: Yu-Chien Peter Lin <peter.lin@sifive.com>
---
lib/sbi/sbi_init.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/sbi/sbi_init.c b/lib/sbi/sbi_init.c
index 5259064b1..aed2b96f8 100644
--- a/lib/sbi/sbi_init.c
+++ b/lib/sbi/sbi_init.c
@@ -265,11 +265,11 @@ static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid)
*/
wake_coldboot_harts(scratch);
- rc = sbi_platform_early_init(plat, true);
+ rc = sbi_hart_init(scratch, true);
if (rc)
sbi_hart_hang();
- rc = sbi_hart_init(scratch, true);
+ rc = sbi_platform_early_init(plat, true);
if (rc)
sbi_hart_hang();
@@ -424,11 +424,11 @@ static void __noreturn init_warm_startup(struct sbi_scratch *scratch,
if (rc)
sbi_hart_hang();
- rc = sbi_platform_early_init(plat, false);
+ rc = sbi_hart_init(scratch, false);
if (rc)
sbi_hart_hang();
- rc = sbi_hart_init(scratch, false);
+ rc = sbi_platform_early_init(plat, false);
if (rc)
sbi_hart_hang();
--
2.43.7
--
opensbi mailing list
opensbi@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi
next prev parent reply other threads:[~2026-02-24 3:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-24 3:17 [RFC PATCH 1/3] platform: sifive: Add initial support for SiFive development platform Yu-Chien Peter Lin
2026-02-24 3:17 ` Yu-Chien Peter Lin [this message]
2026-03-22 5:58 ` [RFC PATCH 2/3] lib: sbi_init: Call hart init before platform early init Anup Patel
2026-02-24 3:17 ` [RFC PATCH 3/3] sifive_dev_platform: Set default MMIO region when SmePMP is enabled Yu-Chien Peter Lin
2026-04-06 5:40 ` Anup Patel
2026-04-06 5:40 ` [RFC PATCH 1/3] platform: sifive: Add initial support for SiFive development platform 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=20260224031733.3817148-2-peter.lin@sifive.com \
--to=peter.lin@sifive.com \
--cc=greentime.hu@sifive.com \
--cc=opensbi@lists.infradead.org \
--cc=zong.li@sifive.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox