From: Yao Zi <ziyao@disroot.org>
To: opensbi@lists.infradead.org
Subject: [PATCH 0/2] Register Zicntr in FDT when emulating is possible
Date: Fri, 14 Mar 2025 03:48:39 +0000 [thread overview]
Message-ID: <Z9OnF49ocru1Dlro@pie> (raw)
In-Reply-To: <20250225154103.5229-1-ziyao@disroot.org>
On Tue, Feb 25, 2025 at 03:41:01PM +0000, Yao Zi wrote:
> OpenSBI is capable of emulating time CSR on HARTs without a full Zicntr
> extension. Previously, we hardcoded Zicntr extension in the devicetree
> for these cores, like JH7110 in mainline Linux[1]. This doesn't reflect
> the hardware and may confuse pre-SBI bootloaders, like U-Boot running in
> M-Mode.
>
> To solve the issue, let's register Zicntr in FDT dynamically for cores
> supporting it by SBI emulation, allowing pre-SBI stages to detect Zicntr
> availability reliably with riscv,isa-extensions.
Ping on this series, are there any more comments? If no I'll improve the
commit message of PATCH 1 and send v2 soon.
Thanks,
Yao Zi
> [1]: https://elixir.bootlin.com/linux/v6.14-rc3/source/arch/riscv/boot/dts/starfive/jh7110.dtsi#L61
>
> Yao Zi (2):
> lib: sbi: hart: Detect existence of cycle and instret CSRs for Zicntr
> lib: utils: fdt: Claim Zicntr if time CSR emulation is possible
>
> include/sbi/sbi_hart.h | 8 ++++++--
> lib/sbi/sbi_hart.c | 30 ++++++++++++++++++++++--------
> lib/sbi/sbi_timer.c | 2 +-
> lib/utils/fdt/fdt_fixup.c | 30 +++++++++++++++++++++++++++++-
> 4 files changed, 58 insertions(+), 12 deletions(-)
>
> --
> 2.48.1
>
prev parent reply other threads:[~2025-03-14 3:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-25 15:41 [PATCH 0/2] Register Zicntr in FDT when emulating is possible Yao Zi
2025-02-25 15:41 ` [PATCH 1/2] lib: sbi: hart: Detect existence of cycle and instret CSRs for Zicntr Yao Zi
2025-02-26 6:26 ` Xiang W
2025-02-26 7:04 ` Yao Zi
2025-03-25 8:15 ` Anup Patel
2025-03-25 8:43 ` Yao Zi
2025-02-25 15:41 ` [PATCH 2/2] lib: utils: fdt: Claim Zicntr if time CSR emulation is possible Yao Zi
2025-03-14 3:48 ` Yao Zi [this message]
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=Z9OnF49ocru1Dlro@pie \
--to=ziyao@disroot.org \
--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.